| Modifier and Type | Field and Description |
|---|---|
| private final List | |
| private int | |
| private int | |
| protected int | |
| protected ByteBuffer | |
| protected int | |
| public static final int | |
| protected long | |
| private final ConcurrentMap | |
| protected long |
| Access | Constructor and Description |
|---|---|
| protected | |
| protected | |
| public | RandomAccessReadBuffer(byte[]
the byte array to be read input)Create a random access buffer using the given byte array. |
| public | RandomAccessReadBuffer(ByteBuffer
the ByteBuffer to be read input)Create a random access buffer using the given ByteBuffer. |
| public | RandomAccessReadBuffer(InputStream
the input stream to be read input)Create a random access read buffer of the given input stream by copying the data to the memory. |
| private |
| Modifier and Type | Method and Description |
|---|---|
| protected void | |
| public void | close()
Implements java. Closes this stream and releases any system resources associated with it. |
| public static RandomAccessReadBuffer | Returns: the RandomAccessReadBuffer holding the data of the InputStreamthe InputStream holding the data to be copied inputStream)Create e new RandomAccessReadBuffer using the given InputStream. |
| public RandomAccessReadView | createView(long
start position within the underlying random access read startPosition, long stream length streamLength)Implements org. Creates a random access read view starting at the given position with the given length. |
| protected void | |
| public long | getPosition()
Implements org. Returns offset of next byte to be returned by a read method. |
| public boolean | isClosed()
Implements org. Returns true if this source has been closed. |
| public boolean | isEOF()
Implements org. A simple test to see if we are at the end of the data. |
| public long | length()
Implements org. The total number of bytes that are available. |
| private void | |
| public int | |
| public int | read(byte[]
The buffer to write the data to. b, int Offset into the buffer to start writing. offset, int The amount of data to attempt to read. length)Implements org. Read a buffer of data. |
| private int | |
| protected void | |
| public void | seek(long
The position to seek to. position)Implements org. Seek to a position in the data. |
| bufferList | back to summary |
|---|---|
| private final List<ByteBuffer> bufferList | |
| bufferListIndex | back to summary |
|---|---|
| private int bufferListIndex | |
| bufferListMaxIndex | back to summary |
|---|---|
| private int bufferListMaxIndex | |
| chunkSize | back to summary |
|---|---|
| protected int chunkSize | |
| currentBuffer | back to summary |
|---|---|
| protected ByteBuffer currentBuffer | |
| currentBufferPointer | back to summary |
|---|---|
| protected int currentBufferPointer | |
| DEFAULT_CHUNK_SIZE_4KB | back to summary |
|---|---|
| public static final int DEFAULT_CHUNK_SIZE_4KB | |
| pointer | back to summary |
|---|---|
| protected long pointer | |
| rarbCopies | back to summary |
|---|---|
| private final ConcurrentMap<Long, RandomAccessReadBuffer> rarbCopies | |
| size | back to summary |
|---|---|
| protected long size | |
| RandomAccessReadBuffer | back to summary |
|---|---|
| protected RandomAccessReadBuffer() Default constructor. | |
| RandomAccessReadBuffer | back to summary |
|---|---|
| protected RandomAccessReadBuffer(int definedChunkSize) Default constructor. | |
| RandomAccessReadBuffer | back to summary |
|---|---|
| public RandomAccessReadBuffer(byte[] input) Create a random access buffer using the given byte array.
| |
| RandomAccessReadBuffer | back to summary |
|---|---|
| public RandomAccessReadBuffer(ByteBuffer input) Create a random access buffer using the given ByteBuffer.
| |
| RandomAccessReadBuffer | back to summary |
|---|---|
| public RandomAccessReadBuffer(InputStream input) throws IOException Create a random access read buffer of the given input stream by copying the data to the memory.
| |
| RandomAccessReadBuffer | back to summary |
|---|---|
| private RandomAccessReadBuffer(RandomAccessReadBuffer parent) | |
| checkClosed | back to summary |
|---|---|
| protected void checkClosed() throws IOException Ensure that the RandomAccessBuffer is not closed
| |
| close | back to summary |
|---|---|
| public void close() throws IOException Implements java. Doc from java. Closes this stream and releases any system resources associated with it. If the stream is already closed then invoking this method has no effect. As noted in
| |
| createBufferFromStream | back to summary |
|---|---|
| public static RandomAccessReadBuffer createBufferFromStream(InputStream inputStream) throws IOException Create e new RandomAccessReadBuffer using the given InputStream. The data is copied to the memory and the InputStream is closed.
| |
| createView | back to summary |
|---|---|
| public RandomAccessReadView createView(long startPosition, long streamLength) throws IOException Implements org. Doc from org. Creates a random access read view starting at the given position with the given length.
| |
| expandBuffer | back to summary |
|---|---|
| protected void expandBuffer() throws IOException create a new buffer chunk and adjust all pointers and indices. | |
| getPosition | back to summary |
|---|---|
| public long getPosition() throws IOException Implements org. Doc from org. Returns offset of next byte to be returned by a read method.
| |
| isClosed | back to summary |
|---|---|
| public boolean isClosed() Implements org. Doc from org. Returns true if this source has been closed.
| |
| isEOF | back to summary |
|---|---|
| public boolean isEOF() throws IOException Implements org. Doc from org. A simple test to see if we are at the end of the data.
| |
| length | back to summary |
|---|---|
| public long length() throws IOException Implements org. Doc from org. The total number of bytes that are available.
| |
| nextBuffer | back to summary |
|---|---|
| private void nextBuffer() throws IOException switch to the next buffer chunk and reset the buffer pointer. | |
| read | back to summary |
|---|---|
| public int read() throws IOException Implements org. Doc from org. Read a single byte of data.
| |
| read | back to summary |
|---|---|
| public int read(byte[] b, int offset, int length) throws IOException Implements org. Doc from org. Read a buffer of data.
| |
| readRemainingBytes | back to summary |
|---|---|
| private int readRemainingBytes(byte[] b, int offset, int length) | |
| resetBuffers | back to summary |
|---|---|
| protected void resetBuffers() Reset to position 0 and remove all buffers but the first one. | |
| seek | back to summary |
|---|---|
| public void seek(long position) throws IOException Implements org. Doc from org. Seek to a position in the data.
| |