public final class DynamicByteArray extends Object
| Constructor and Description |
|---|
DynamicByteArray() |
DynamicByteArray(int size) |
| Modifier and Type | Method and Description |
|---|---|
int |
add(byte value) |
int |
add(byte[] value,
int valueOffset,
int valueLength)
Copy a slice of a byte array into our buffer.
|
void |
clear()
Clear the array to its original pristine state.
|
int |
compare(int otherOffset,
int otherLength,
int ourOffset,
int ourLength)
Byte compare a set of bytes against the bytes in this dynamic array.
|
boolean |
equals(io.airlift.slice.Slice other,
int otherOffset,
int otherLength,
int ourOffset,
int ourLength) |
byte |
get(int index) |
long |
getSizeInBytes()
Get the size of the buffers.
|
void |
read(InputStream in,
int lengthToRead)
Read lengthToRead bytes from the input stream into this array
|
void |
readAll(InStream in)
Read the entire stream into this array.
|
void |
set(int index,
byte value) |
void |
setByteBuffer(ByteBuffer result,
int offset,
int length) |
void |
setText(org.apache.hadoop.io.Text result,
int offset,
int length)
Set a text value from the bytes in this dynamic array.
|
int |
size()
Get the size of the array.
|
String |
toString() |
void |
write(OutputStream out,
int offset,
int length)
Write out a range of this dynamic array to an output stream.
|
public DynamicByteArray()
public DynamicByteArray(int size)
public byte get(int index)
public void set(int index,
byte value)
public int add(byte value)
public int add(byte[] value,
int valueOffset,
int valueLength)
value - the array to copy fromvalueOffset - the first location to copy from valuevalueLength - the number of bytes to copy from valuepublic void readAll(InStream in) throws IOException
in - the stream to read fromIOExceptionpublic void read(InputStream in, int lengthToRead) throws IOException
in - the stream to read fromlengthToRead - the number of bytes to readIOExceptionpublic int compare(int otherOffset,
int otherLength,
int ourOffset,
int ourLength)
otherOffset - start offset in the other arrayotherLength - number of bytes in the other arrayourOffset - the offset in our arrayourLength - the number of bytes in our arraypublic boolean equals(io.airlift.slice.Slice other,
int otherOffset,
int otherLength,
int ourOffset,
int ourLength)
public int size()
public void clear()
public void setText(org.apache.hadoop.io.Text result,
int offset,
int length)
result - the value to setoffset - the start of the bytes to copylength - the number of bytes to copypublic void write(OutputStream out, int offset, int length) throws IOException
out - the stream to write tooffset - the first offset to writelength - the number of bytes to writeIOExceptionpublic void setByteBuffer(ByteBuffer result, int offset, int length)
public long getSizeInBytes()
Copyright © 2013–2021. All rights reserved.