java.io.Closeable, java.lang.AutoCloseablepublic abstract class PagedInputStream
extends java.io.InputStream
The only method that needs to be implemented is the 'readPageContent' method.
| Constructor | Description |
|---|---|
PagedInputStream(int page_size,
long total_size) |
Constructs the input stream.
|
| Modifier and Type | Method | 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) |
public 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 java.io.IOException
java.io.IOExceptionpublic int read()
throws java.io.IOException
read in class java.io.InputStreamjava.io.IOExceptionpublic int read(byte[] read_buf,
int off,
int len)
throws java.io.IOException
read in class java.io.InputStreamjava.io.IOExceptionpublic long skip(long n)
throws java.io.IOException
skip in class java.io.InputStreamjava.io.IOExceptionpublic int available()
throws java.io.IOException
available in class java.io.InputStreamjava.io.IOExceptionpublic void close()
throws java.io.IOException
close in interface java.lang.AutoCloseableclose in interface java.io.Closeableclose in class java.io.InputStreamjava.io.IOExceptionpublic void mark(int limit)
mark in class java.io.InputStreampublic void reset()
reset in class java.io.InputStreampublic boolean markSupported()
markSupported in class java.io.InputStreamCopyright © 2018. All rights reserved.