public class OutputBuffer extends Object
Modifier and Type | Field and Description |
---|---|
protected boolean |
_valid |
protected static int |
ALIGNMENT |
protected static int |
headerSize |
Constructor and Description |
---|
OutputBuffer()
Create a new buffer.
|
OutputBuffer(byte[] b)
Create a new buffer using the provided byte array.
|
OutputBuffer(int buffSize)
Create a new buffer with the specified initial size.
|
OutputBuffer(OutputBuffer copyFrom)
Create a new OutputBuffer and initialise its state with a copy of the
provided buffer.
|
Modifier and Type | Method and Description |
---|---|
byte[] |
buffer()
Return the byte array used to store data types.
|
void |
copy(OutputBuffer b)
Copy the provided OutputBuffer and overwrite the current instance.
|
int |
length()
Return the length of the byte array being used to store data types.
|
void |
packBoolean(boolean b)
Pack the boolean.
|
void |
packByte(byte b)
Pack a byte.
|
void |
packBytes(byte[] b)
Pack the array of bytes.
|
void |
packChar(char c)
Pack the character.
|
void |
packDouble(double d)
Pack the double.
|
void |
packFloat(float f)
Pack the float.
|
void |
packInt(int i)
Pack the integer.
|
void |
packInto(OutputBuffer buff)
Pack this buffer into that provided.
|
void |
packLong(long l)
Pack the long.
|
void |
packShort(short s)
Pack the short.
|
void |
packString(String s)
Pack the String.
|
void |
print(PrintWriter strm)
Print out information about this instance.
|
void |
reset()
Clear the OutputBuffer and rewind the pack pointer.
|
boolean |
rewrite()
Reset the pack pointer.
|
boolean |
valid()
Is the buffer valid?
|
protected boolean _valid
protected static final int headerSize
protected static final int ALIGNMENT
public OutputBuffer()
public OutputBuffer(int buffSize)
public OutputBuffer(byte[] b)
public OutputBuffer(OutputBuffer copyFrom)
public final boolean valid()
public final byte[] buffer()
public final int length()
public void copy(OutputBuffer b)
public final void reset() throws IOException
IOException
public final void packByte(byte b) throws IOException
IOException
public final void packBytes(byte[] b) throws IOException
IOException
public final void packBoolean(boolean b) throws IOException
IOException
public final void packChar(char c) throws IOException
IOException
public final void packShort(short s) throws IOException
IOException
public final void packInt(int i) throws IOException
IOException
public final void packLong(long l) throws IOException
IOException
public final void packFloat(float f) throws IOException
IOException
public final void packDouble(double d) throws IOException
IOException
public final void packString(String s) throws IOException
IOException
public void packInto(OutputBuffer buff) throws IOException
IOException
public void print(PrintWriter strm)
public final boolean rewrite()
Copyright © 2013. All rights reserved.