| Modifier and Type | Field and Description |
|---|---|
| pack-priv int | |
| pack-priv Vector | |
| pack-priv byte[] | |
| pack-priv int | |
| pack-priv int | |
| pack-priv int | |
| pack-priv int | |
| pack-priv int | |
| pack-priv boolean |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public int | available()
Implements org. Return the number of bytes that can be read from this ByteHolder without blocking on an IO. |
| public void | clear()
Implements org. Clear the bytes from the ByteHolder and place it in writing mode. |
| public ByteHolder | cloneEmpty()
Implements org. Return a byte holder matching existing type and size of current ByteHolder, but don't bother to fill the bytes. |
| private String | |
| protected boolean | Returns: true if the user has read all the bytes in this ByteHolder.Get the next buffer for reading bytes. |
| protected void | |
| protected void | |
| protected void | |
| public int | numBytesSaved()
Implements org. Return the number of bytes that have been saved to this byte holder. |
| public int | read()
Implements org. Read a byte from this ByteHolder. |
| public int | read(byte[] b, int off, int len)
Implements org. Read up to 'len' bytes from this ByteHolder and store them in an array at offset 'off'. |
| public int | read(OutputStream out, int len)
Implements org. Read from the ByteHolder. |
| public int | |
| public int | shiftToFront()
Implements org. shift the remaining unread bytes to the beginning of the byte holder |
| public long | skip(long count)
Implements org. Skip over the specified number of bytes in a ByteHolder. |
| public void | startReading()
Implements org. Place a ByteHolder in reading mode. |
| public String | toString()
Overrides java. Produce a string describing the state of this ByteHolder. |
| public void | write(int b)
Implements org. Write a byte to this ByteHolder. |
| public void | write(byte[] data, int offset, int len)
Implements org. Write len bytes of data starting at 'offset' to this ByteHolder. |
| public long | write(InputStream is, long count)
Implements org. Write up to count bytes from an input stream to this ByteHolder. |
| public boolean | writingMode()
Implements org. Return true if this is in writing mode. |
| bufSize | back to summary |
|---|---|
| pack-priv int bufSize | |
| bufV | back to summary |
|---|---|
| pack-priv Vector<byte[]> bufV | |
| curBuf | back to summary |
|---|---|
| pack-priv byte[] curBuf | |
| curBufDataBytes | back to summary |
|---|---|
| pack-priv int curBufDataBytes | |
| curBufPos | back to summary |
|---|---|
| pack-priv int curBufPos | |
| curBufVEleAt | back to summary |
|---|---|
| pack-priv int curBufVEleAt | |
| lastBufDataBytes | back to summary |
|---|---|
| pack-priv int lastBufDataBytes | |
| lastBufVEleAt | back to summary |
|---|---|
| pack-priv int lastBufVEleAt | |
| writing | back to summary |
|---|---|
| pack-priv boolean writing | |
| MemByteHolder | back to summary |
|---|---|
| public MemByteHolder(int bufSize) Create a new MemByteHolder. Store bytes as a list of buffers of size 'bufSize'. | |
| available | back to summary |
|---|---|
| public int available() Implements org. Doc from org. Return the number of bytes that can be read from this ByteHolder without blocking on an IO.
| |
| clear | back to summary |
|---|---|
| public void clear() throws IOException Implements org. Doc from org. Clear the bytes from the ByteHolder and place it in writing mode. This may not free the memory the ByteHolder uses to store data.
| |
| cloneEmpty | back to summary |
|---|---|
| public ByteHolder cloneEmpty() Implements org. Doc from org. Return a byte holder matching existing type and size of current ByteHolder, but don't bother to fill the bytes. Normal usage is expected to reset the holding stream to the beginning, so the copy of current state would be wasted.
| |
| dumpBuf | back to summary |
|---|---|
| private String dumpBuf(int bufVEleAt) Create a string representation of an internal buffer of bytes. This is useful during debugging. | |
| getNextBuffer_r | back to summary |
|---|---|
| protected boolean getNextBuffer_r() throws IOException Get the next buffer for reading bytes.
| |
| getNextBuffer_w | back to summary |
|---|---|
| protected void getNextBuffer_w() throws IOException Get the next buffer for writing bytes.
| |
| getNextBuffer_w_Sanity | back to summary |
|---|---|
| protected void getNextBuffer_w_Sanity() Do sanity checking when getting the next write buffer | |
| initBuffer_w | back to summary |
|---|---|
| protected void initBuffer_w() Initialize a buffer for writing | |
| numBytesSaved | back to summary |
|---|---|
| public int numBytesSaved() Implements org. Return the number of bytes that have been saved to this byte holder. This result is different from available() as it is unaffected by the current read position on the ByteHolder.
| |
| read | back to summary |
|---|---|
| public int read() throws IOException Implements org. Doc from org. Read a byte from this ByteHolder. The ByteHolder must be in reading mode to call this.
| |
| read | back to summary |
|---|---|
| public int read(byte[] b, int off, int len) throws IOException Implements org. Doc from org. Read up to 'len' bytes from this ByteHolder and store them in an array at offset 'off'. The ByteHolder must be in reading mode to call this.
| |
| read | back to summary |
|---|---|
| public int read(OutputStream out, int len) throws IOException Implements org. Doc from org. Read from the ByteHolder. Read up to 'len' bytes from this ByteHolder and write them to the OutputStream The ByteHolder must be in reading mode to call this.
| |
| read | back to summary |
|---|---|
public int read(byte[] b, int off, OutputStream out, int len) throws IOException
| |
| shiftToFront | back to summary |
|---|---|
| public int shiftToFront() throws IOException Implements org. Doc from org. shift the remaining unread bytes to the beginning of the byte holder
| |
| skip | back to summary |
|---|---|
| public long skip(long count) throws IOException Implements org. Doc from org. Skip over the specified number of bytes in a ByteHolder.
| |
| startReading | back to summary |
|---|---|
| public void startReading() throws IOException Implements org. Doc from org. Place a ByteHolder in reading mode. After this call, reads scan bytes sequentially in the order they were written to the ByteHolder starting from the first byte. When the ByteHolder is already in readmode this simply arranges for reads to start at the beginning of the sequence of saved bytes.
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Produce a string describing the state of this ByteHolder. This is mainly for debugging.
| |
| write | back to summary |
|---|---|
| public void write(int b) throws IOException Implements org. Doc from org. Write a byte to this ByteHolder. The ByteHolder must be in writing mode to call this.
| |
| write | back to summary |
|---|---|
| public void write(byte[] data, int offset, int len) throws IOException Implements org. Doc from org. Write len bytes of data starting at 'offset' to this ByteHolder. The ByteHolder must be in writing mode to call this.
| |
| write | back to summary |
|---|---|
| public long write(InputStream is, long count) throws IOException Implements org. Doc from org. Write up to count bytes from an input stream to this ByteHolder. This may write fewer bytes if it encounters an end of file on the input stream.
| |
| writingMode | back to summary |
|---|---|
| public boolean writingMode() Implements org. Doc from org. Return true if this is in writing mode.
| |