public class LinkedBuffer extends Object
Modifier and Type | Field and Description |
---|---|
protected byte[] |
buffer
The internal buffer.
|
protected int |
bufferSize
The size of the internal buffer
|
static int |
DEFAULT_BUFFER_SIZE
The default size of the internal buffer in bytes
The buffer has to be big enough to allocate a single write, i.e we cannot write
*at once* more than bufferSize bytes
|
protected LinkedBuffer |
next
The next buffer in the list
|
Constructor and Description |
---|
LinkedBuffer()
Default Constructor.
|
LinkedBuffer(int _bufferSize)
Constructor
|
Modifier and Type | Method and Description |
---|---|
byte[] |
getBuffer() |
int |
getBufferSize() |
LinkedBuffer |
getNext() |
int |
getPosition() |
void |
setNext(LinkedBuffer _next)
Set the next buffer in the list
|
boolean |
write(int b)
Writes a byte in the buffer
|
boolean |
writeByte(byte b)
Writes a byte in the buffer
|
protected byte[] buffer
protected int bufferSize
public static final int DEFAULT_BUFFER_SIZE
protected LinkedBuffer next
public LinkedBuffer()
public LinkedBuffer(int _bufferSize)
_bufferSize
- size in bytes of the buffer.public LinkedBuffer getNext()
public void setNext(LinkedBuffer _next)
_next
- next LinkedBuffer in the listpublic boolean write(int b) throws IOException
b
- int containing the byte to writeIOException
public boolean writeByte(byte b) throws IOException
b
- byte to writeIOException
public int getBufferSize()
public int getPosition()
public byte[] getBuffer()
Terrier 4.0. Copyright © 2004-2014 University of Glasgow