Package org.apache.accumulo.core.util
Class UnsynchronizedBuffer.Reader
- java.lang.Object
-
- org.apache.accumulo.core.util.UnsynchronizedBuffer.Reader
-
- Enclosing class:
- UnsynchronizedBuffer
public static class UnsynchronizedBuffer.Reader extends Object
A byte buffer reader.
-
-
Constructor Summary
Constructors Constructor Description Reader(byte[] b)
Creates a new reader.Reader(ByteBuffer buffer)
Creates a new reader.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
readBoolean()
Reads a Boolean value from this reader's buffer.void
readBytes(byte[] b)
Reads bytes from this reader's buffer, filling the given byte array.int
readInt()
Reads an integer value from this reader's buffer.long
readLong()
Reads a long value from this reader's buffer.int
readVInt()
Reads an integer value from this reader's buffer, assuming the integer was encoded as a variable-length list of bytes.long
readVLong()
Reads a long value from this reader's buffer, assuming the long was encoded as a variable-length list of bytes.
-
-
-
Constructor Detail
-
Reader
public Reader(byte[] b)
Creates a new reader.- Parameters:
b
- bytes to read
-
Reader
public Reader(ByteBuffer buffer)
Creates a new reader.- Parameters:
buffer
- byte buffer containing bytes to read
-
-
Method Detail
-
readInt
public int readInt()
Reads an integer value from this reader's buffer.- Returns:
- integer value
-
readLong
public long readLong()
Reads a long value from this reader's buffer.- Returns:
- long value
-
readBytes
public void readBytes(byte[] b)
Reads bytes from this reader's buffer, filling the given byte array.- Parameters:
b
- byte array to fill
-
readBoolean
public boolean readBoolean()
Reads a Boolean value from this reader's buffer.- Returns:
- Boolean value
-
readVInt
public int readVInt()
Reads an integer value from this reader's buffer, assuming the integer was encoded as a variable-length list of bytes.- Returns:
- integer value
-
readVLong
public long readVLong()
Reads a long value from this reader's buffer, assuming the long was encoded as a variable-length list of bytes.- Returns:
- long value
-
-