public class LinkedBuffer extends Object
| Modifier and Type | Field and Description | 
|---|---|
| protected byte[] | bufferThe internal buffer. | 
| protected int | bufferSizeThe size of the internal buffer | 
| static int | DEFAULT_BUFFER_SIZEThe 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 | nextThe 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 writeIOExceptionpublic boolean writeByte(byte b)
                  throws IOException
b - byte to writeIOExceptionpublic int getBufferSize()
public int getPosition()
public byte[] getBuffer()
Terrier Information Retrieval Platform4.1. Copyright © 2004-2015, University of Glasgow