public class ReusableByteArray extends Object implements ReusableBuffer<byte[]>
Modifier and Type | Field and Description |
---|---|
protected byte[] |
bytes |
protected static byte[] |
EMPTY_BYTES |
protected int |
length |
Constructor and Description |
---|
ReusableByteArray() |
ReusableByteArray(byte[] data) |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o) |
byte[] |
getBuffer()
Get the buffer backing this ReusableBuffer.
|
long |
getLength()
Get the number of bytes in the byte array.
|
int |
hashCode() |
void |
set(ArrowBuf srcBytes,
long start,
long len)
Set the buffer to the contents of the given ArrowBuf.
|
protected void |
setCapacity(int len,
boolean keepData)
Sets the capacity of this object to at least
len bytes. |
String |
toString() |
protected static final byte[] EMPTY_BYTES
protected byte[] bytes
protected int length
public ReusableByteArray()
public ReusableByteArray(byte[] data)
public long getLength()
getLength
in interface ReusableBuffer<byte[]>
public byte[] getBuffer()
ReusableBuffer
getBuffer
in interface ReusableBuffer<byte[]>
public void set(ArrowBuf srcBytes, long start, long len)
ReusableBuffer
set
in interface ReusableBuffer<byte[]>
srcBytes
- the data to copy fromstart
- the first position of the new datalen
- the number of bytes of the new dataprotected void setCapacity(int len, boolean keepData)
len
bytes. If the
current buffer is longer, then the capacity and existing content of the buffer are unchanged.
If len
is larger than the current capacity, the Text object's capacity is
increased to match.len
- the number of bytes we needkeepData
- should the old data be keptCopyright © 2024 The Apache Software Foundation. All rights reserved.