|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.terrier.compression.LinkedBuffer
public class LinkedBuffer
Implements an element of a linked list that contains a byte array
| Field Summary | |
|---|---|
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 Summary | |
|---|---|
LinkedBuffer()
Default Constructor. |
|
LinkedBuffer(int _bufferSize)
Constructor |
|
| Method Summary | |
|---|---|
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 |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected byte[] buffer
protected int bufferSize
public static final int DEFAULT_BUFFER_SIZE
protected LinkedBuffer next
| Constructor Detail |
|---|
public LinkedBuffer()
public LinkedBuffer(int _bufferSize)
_bufferSize - size in bytes of the buffer.| Method Detail |
|---|
public LinkedBuffer getNext()
public void setNext(LinkedBuffer _next)
_next - next LinkedBuffer in the list
public boolean write(int b)
throws java.io.IOException
b - int containing the byte to write
java.io.IOException
public boolean writeByte(byte b)
throws java.io.IOException
b - byte to write
java.io.IOExceptionpublic int getBufferSize()
public int getPosition()
public byte[] getBuffer()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||