public abstract class PagedInputStream extends InputStream
The only method that needs to be implemented is the 'readPageContent' method.
| Constructor and Description |
|---|
PagedInputStream(int page_size,
long total_size)
Constructs the input stream.
|
| Modifier and Type | Method and Description |
|---|---|
int |
available() |
void |
close() |
void |
mark(int limit) |
boolean |
markSupported() |
int |
read() |
int |
read(byte[] read_buf,
int off,
int len) |
protected abstract void |
readPageContent(byte[] buf,
long pos,
int length)
Reads the page at the given offset in the underlying data into the given
byte[] array.
|
void |
reset() |
long |
skip(long n) |
readpublic PagedInputStream(int page_size,
long total_size)
page_size - the size of the pages when accessing the underlying
stream.total_size - the total size of the underlying data set.protected abstract void readPageContent(byte[] buf,
long pos,
int length)
throws IOException
IOExceptionpublic int read()
throws IOException
read in class InputStreamIOExceptionpublic int read(byte[] read_buf,
int off,
int len)
throws IOException
read in class InputStreamIOExceptionpublic long skip(long n)
throws IOException
skip in class InputStreamIOExceptionpublic int available()
throws IOException
available in class InputStreamIOExceptionpublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableclose in class InputStreamIOExceptionpublic void mark(int limit)
mark in class InputStreampublic void reset()
reset in class InputStreampublic boolean markSupported()
markSupported in class InputStreamCopyright © 2019. All rights reserved.