abstract class Buffer extends Object
Modifier and Type | Class and Description |
---|---|
static class |
Buffer.BigEndian |
static class |
Buffer.LittleEndian |
Modifier and Type | Field and Description |
---|---|
protected byte[] |
data |
protected int |
position |
Constructor and Description |
---|
Buffer() |
Modifier and Type | Method and Description |
---|---|
byte[] |
close(boolean trimmedCopy)
Closes this buffer.
|
byte[] |
copyData(int start,
int end) |
void |
copyInto(byte[] dst,
int off,
int len)
Copies the data from this buffer into a given array.
|
void |
emitByte(int b) |
int |
emitByte(int b,
int pos) |
int |
emitBytes(byte[] arr,
int pos) |
void |
emitBytes(byte[] arr,
int off,
int len) |
void |
emitInt(int b) |
abstract int |
emitInt(int b,
int pos) |
void |
emitLong(long b) |
abstract int |
emitLong(long b,
int pos) |
void |
emitShort(int b) |
abstract int |
emitShort(int b,
int pos) |
protected void |
ensureSize(int length) |
int |
getByte(int pos) |
abstract int |
getInt(int pos) |
abstract int |
getShort(int pos) |
int |
position() |
void |
reset() |
void |
setPosition(int position) |
public Buffer()
public int position()
public void setPosition(int position)
public byte[] close(boolean trimmedCopy)
trimmedCopy
- if true
, then a copy of the underlying byte array up to (but not
including) position()
is returnedtrimmedCopy
is true
public byte[] copyData(int start, int end)
public void copyInto(byte[] dst, int off, int len)
dst
- the destination arrayoff
- starting position in dst
len
- number of bytes to copyprotected void ensureSize(int length)
public void emitBytes(byte[] arr, int off, int len)
public void emitByte(int b)
public void emitShort(int b)
public void emitInt(int b)
public void emitLong(long b)
public int emitBytes(byte[] arr, int pos)
public int emitByte(int b, int pos)
public abstract int emitShort(int b, int pos)
public abstract int emitInt(int b, int pos)
public abstract int emitLong(long b, int pos)
public int getByte(int pos)
public abstract int getShort(int pos)
public abstract int getInt(int pos)
public void reset()