Package com.mckoi.database.jdbc
Class AbstractStreamableObject.StreamableObjectInputStream
- java.lang.Object
-
- java.io.InputStream
-
- com.mckoi.util.PagedInputStream
-
- com.mckoi.database.jdbc.AbstractStreamableObject.StreamableObjectInputStream
-
- All Implemented Interfaces:
java.io.Closeable
,java.lang.AutoCloseable
- Enclosing class:
- AbstractStreamableObject
class AbstractStreamableObject.StreamableObjectInputStream extends PagedInputStream
An InputStream that is used to read the data from the streamable object as a basic byte encoding. This maintains an internal buffer.
-
-
Field Summary
Fields Modifier and Type Field Description private static int
B_SIZE
The default size of the buffer.
-
Constructor Summary
Constructors Constructor Description StreamableObjectInputStream(long in_size)
Construct the input stream.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
readPageContent(byte[] buf, long pos, int length)
Reads the page at the given offset in the underlying data into the given byte[] array.-
Methods inherited from class com.mckoi.util.PagedInputStream
available, close, mark, markSupported, read, read, reset, skip
-
-
-
-
Field Detail
-
B_SIZE
private static final int B_SIZE
The default size of the buffer.- See Also:
- Constant Field Values
-
-
Method Detail
-
readPageContent
protected void readPageContent(byte[] buf, long pos, int length) throws java.io.IOException
Description copied from class:PagedInputStream
Reads the page at the given offset in the underlying data into the given byte[] array. The 'pos' variable given is guarenteed to be a multiple of buffer_size. For example, the first access will be to pos = 0, the second access to pos = BUFFER_SIZE, the third access to pos = BUFFER_SIZE * 2, etc. 'length' will always be either BUFFER_SIZE or a value smaller than BUFFER_SIZE if the page containing the end of the stream is read.- Specified by:
readPageContent
in classPagedInputStream
- Throws:
java.io.IOException
-
-