public class GrowableByteBuffer extends Object
| Modifier and Type | Field and Description |
|---|---|
static byte[] |
ZERO_BYTE
Constant for a single zero byte.
|
| Constructor and Description |
|---|
GrowableByteBuffer()
Creates an empty buffer.
|
| Modifier and Type | Method and Description |
|---|---|
byte[] |
getBufferAccess()
Direct buffer access, handle with care.
|
ByteBuffer |
getByteBuffer(int length)
Reserves a byte buffer.
|
int |
getPosition()
Returns the position in the buffer that is next written to.
|
byte[] |
toByteArray() |
void |
write(byte b)
Writes a byte, appending it to the buffer.
|
void |
write(byte[] b)
Writes a byte array, appending it to the buffer.
|
void |
writeTo(int p,
byte b)
Writes a single byte to a position in the buffer.
|
public void write(byte b)
b - The byte.public void write(byte[] b)
b - The byte array.public ByteBuffer getByteBuffer(int length)
public void writeTo(int p,
byte b)
p - The position.b - The byte.public int getPosition()
public byte[] getBufferAccess()
public byte[] toByteArray()
Copyright © 2012. All Rights Reserved.