| Modifier and Type | Field and Description |
|---|---|
| private byte[] | data
The data itself. |
| private int | pos
The current write or read position. |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public void | checkCapacity(int
the number of additional bytes required plus)Check if there is still enough capacity in the buffer. |
| public static void | copyString(Reader
the reader source, OutputStream the output stream target)Copy a String from a reader to an output stream. |
| public static Data | |
| private void | |
| public void | fillAligned()
Fill up the buffer with empty space and an (initially empty) checksum until the size is a multiple of Constants.FILE_BLOCK_SIZE. |
| public byte[] | |
| public int | Returns: the lengthGet the current write position of this buffer, which is the current length. |
| public void | read(byte[]
the output buffer buff, int the offset in the output buffer off, int the number of bytes to copy len)Copy a number of bytes to the given buffer from the current position. |
| public byte | |
| public int | |
| public void | |
| public void | |
| public void | write(byte[]
the data buff, int the offset in the data off, int the length in bytes len)Append a number of bytes to this buffer. |
| public void | |
| private void |
| data | back to summary |
|---|---|
| private byte[] data The data itself. | |
| pos | back to summary |
|---|---|
| private int pos The current write or read position. | |
| Data | back to summary |
|---|---|
| private Data(byte[] data) | |
| checkCapacity | back to summary |
|---|---|
| public void checkCapacity(int plus) Check if there is still enough capacity in the buffer. This method extends the buffer if required.
| |
| copyString | back to summary |
|---|---|
| public static void copyString(Reader source, OutputStream target) throws IOException Copy a String from a reader to an output stream.
| |
| create | back to summary |
|---|---|
| public static Data create(int capacity) Create a new buffer.
| |
| expand | back to summary |
|---|---|
| private void expand(int plus) | |
| fillAligned | back to summary |
|---|---|
| public void fillAligned() Fill up the buffer with empty space and an (initially empty) checksum until the size is a multiple of Constants.FILE_BLOCK_SIZE. | |
| getBytes | back to summary |
|---|---|
| public byte[] getBytes() Get the byte array used for this page.
| |
| length | back to summary |
|---|---|
| public int length() Get the current write position of this buffer, which is the current length.
| |
| read | back to summary |
|---|---|
| public void read(byte[] buff, int off, int len) Copy a number of bytes to the given buffer from the current position. The current position is incremented accordingly.
| |
| readByte | back to summary |
|---|---|
| public byte readByte() Read one single byte.
| |
| readInt | back to summary |
|---|---|
| public int readInt() Read an integer at the current position. The current position is incremented.
| |
| reset | back to summary |
|---|---|
| public void reset() Set the position to 0. | |
| setPos | back to summary |
|---|---|
| public void setPos(int pos) Set the current read / write position.
| |
| write | back to summary |
|---|---|
| public void write(byte[] buff, int off, int len) Append a number of bytes to this buffer.
| |
| writeInt | back to summary |
|---|---|
| public void writeInt(int x) Write an integer at the current position. The current position is incremented.
| |
| writeStringWithoutLength | back to summary |
|---|---|
| private void writeStringWithoutLength(char[] chars, int len) | |