Package com.mckoi.database
Class BlobStore.BLOBInputStream
- java.lang.Object
-
- java.io.InputStream
-
- com.mckoi.util.PagedInputStream
-
- com.mckoi.database.BlobStore.BLOBInputStream
-
- All Implemented Interfaces:
java.io.Closeable
,java.lang.AutoCloseable
- Enclosing class:
- BlobStore
private class BlobStore.BLOBInputStream extends PagedInputStream
An InputStream implementation that reads from the underlying blob data as fixed size pages.
-
-
Field Summary
Fields Modifier and Type Field Description (package private) static int
B_SIZE
private long
reference_id
-
Constructor Summary
Constructors Constructor Description BLOBInputStream(long reference_id, long size)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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
static final int B_SIZE
- See Also:
- Constant Field Values
-
reference_id
private long reference_id
-
-
Method Detail
-
readPageContent
public 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
-
-