Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1183,7 +1183,9 @@ public ArrowBuf setZero(long index, long length) {
* this ArrowBuf has access to)
* @param length length of bytes to set.
* @return this ArrowBuf
* @deprecated use {@link ArrowBuf#setOne(long, long)} instead.
*/
@Deprecated
public ArrowBuf setOne(int index, int length) {
if (length != 0) {
this.checkIndex(index, length);
Expand All @@ -1192,6 +1194,21 @@ public ArrowBuf setOne(int index, int length) {
return this;
}

/**
* Sets all bits to one in the specified range.
* @param index index index (0 based relative to the portion of memory
* this ArrowBuf has access to)
* @param length length of bytes to set.
* @return this ArrowBuf
*/
public ArrowBuf setOne(long index, long length) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we leave behind an @Deprecated version of this with the original signature, then remove it in v12?

if (length != 0) {
this.checkIndex(index, length);
MemoryUtil.UNSAFE.setMemory(this.addr + index, length, (byte) 0xff);
}
return this;
}

/**
* Returns <code>this</code> if size is less then {@link #capacity()}, otherwise
* delegates to {@link BufferManager#replace(ArrowBuf, long)} to get a new buffer.
Expand Down