public class PrefixByteBuffer
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static int |
CHUNK_SIZE |
Constructor and Description |
---|
PrefixByteBuffer() |
Modifier and Type | Method and Description |
---|---|
void |
clear()
Method: clear()
Description: Reset buffer to its empty state.
|
void |
flip()
Method: flip()
Description: Similar the ByteBuffer.flip() but the position must be
set back to the start of the prefix.
|
byte[] |
getBackingArray()
Method: getBackingArray()
Description: Returns a pointer to the backing array
Note: DANGEROUS.
|
byte |
getByte() |
void |
getBytes(byte[] buf) |
void |
getBytes(java.nio.ByteBuffer bBuf) |
int |
getInt() |
int |
getStartOffset() |
java.lang.String |
getUTF8() |
int |
length() |
void |
pushByte(int b)
Write bytes to start methods
|
void |
pushBytes(byte[] b) |
void |
pushInt(int v) |
void |
putByte(int b)
Write bytes to end methods
|
void |
putBytes(byte[] b) |
void |
putInt(int v) |
void |
putUTF8(java.lang.String s) |
void |
readFrom(java.nio.ByteBuffer buf)
Method: readFrom()
Description: Read a BufferBuffer into self as if it had been received
from an InputStream.
|
void |
readFrom(java.io.InputStream is,
int length)
Method: readFrom()
Description: Reads a given number of bytes from a given input stream.
|
void |
writeTo(java.nio.ByteBuffer buf) |
void |
writeTo(java.io.OutputStream os)
Method: writeTo()
Description: Write data to a given OutputStream.
|
public static final int CHUNK_SIZE
public int length()
public void flip()
public void clear()
public void writeTo(java.io.OutputStream os) throws java.io.IOException
java.io.IOException
public void writeTo(java.nio.ByteBuffer buf)
public void readFrom(java.io.InputStream is, int length) throws java.io.IOException
java.io.IOException
public void readFrom(java.nio.ByteBuffer buf)
public byte[] getBackingArray()
public int getStartOffset()
public void putByte(int b)
public void putBytes(byte[] b)
public void putUTF8(java.lang.String s) throws java.io.IOException
java.io.IOException
public void putInt(int v)
public void pushByte(int b) throws java.nio.BufferOverflowException
java.nio.BufferOverflowException
public void pushBytes(byte[] b) throws java.nio.BufferOverflowException
java.nio.BufferOverflowException
public void pushInt(int v)
public byte getByte()
public int getInt()
public void getBytes(byte[] buf)
public void getBytes(java.nio.ByteBuffer bBuf)
public java.lang.String getUTF8() throws java.io.IOException
java.io.IOException