Package com.rtfparserkit.parser.raw
Class ByteBuffer
- java.lang.Object
-
- com.rtfparserkit.parser.raw.ByteBuffer
-
class ByteBuffer extends java.lang.ObjectImplements a simple byte array based buffer. Used to collect data one byte at a time into a buffer, then pass the collected data to the caller as an array.
-
-
Field Summary
Fields Modifier and Type Field Description private byte[]bufferprivate intbufferSizeprivate static intINITIAL_BUFFER_CAPACITY
-
Constructor Summary
Constructors Constructor Description ByteBuffer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(int b)Add a byte to the buffer.voidclear()Clear the buffer.booleanisEmpty()Determines if the buffer is empty.byte[]toArray()Return the buffer as an array.java.lang.StringtoString()
-
-
-
Field Detail
-
INITIAL_BUFFER_CAPACITY
private static final int INITIAL_BUFFER_CAPACITY
- See Also:
- Constant Field Values
-
bufferSize
private int bufferSize
-
buffer
private byte[] buffer
-
-
Method Detail
-
add
public void add(int b)
Add a byte to the buffer.
-
clear
public void clear()
Clear the buffer.
-
toArray
public byte[] toArray()
Return the buffer as an array.
-
isEmpty
public boolean isEmpty()
Determines if the buffer is empty.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-