public final class CodeStream
extends java.lang.Object
| Constructor and Description |
|---|
CodeStream()
Constructs a new
CodeStream with a default initial
size. |
CodeStream(int initialSize)
Constructs a new
CodeStream with the given initial
size. |
| Modifier and Type | Method and Description |
|---|---|
byte[] |
getData() |
int |
getLength() |
CodeStream |
putByte(int b)
Puts a byte into this byte stream.
|
CodeStream |
putByteArray(byte[] b,
int offset,
int length)
Puts an array of bytes into this byte stream.
|
CodeStream |
putDouble(double d)
Puts a double into this byte stream.
|
CodeStream |
putFloat(float f)
Puts a float into this byte stream.
|
CodeStream |
putInt(int i)
Puts an int into this byte stream.
|
CodeStream |
putLong(long l)
Puts a long into this byte stream.
|
CodeStream |
putShort(int s)
Puts a short into this byte stream.
|
CodeStream |
putUtf8(java.lang.String s)
Puts an UTF8 string into this byte stream.
|
void |
reset() |
void |
reset(int initialSize) |
public CodeStream()
CodeStream with a default initial
size.public CodeStream(int initialSize)
CodeStream with the given initial
size.initialSize - the initial size of the byte stream to be constructed.public void reset()
public void reset(int initialSize)
public byte[] getData()
public int getLength()
public CodeStream putByte(int b)
b - a byte.public CodeStream putShort(int s)
s - a short.public CodeStream putInt(int i)
i - an int.public CodeStream putLong(long l)
l - a long.public CodeStream putFloat(float f)
f - a float.public CodeStream putDouble(double d)
d - a double.public CodeStream putUtf8(java.lang.String s)
s - a String.public CodeStream putByteArray(byte[] b, int offset, int length)
b - an array of bytes. May be null to put length
null bytes into this byte stream.offset - index of the fist byte of b that must be copied.length - number of bytes of b that must be copied.