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) |
read
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 IOException
IOException
public int read() throws IOException
read
in class InputStream
IOException
public int read(byte[] read_buf, int off, int len) throws IOException
read
in class InputStream
IOException
public long skip(long n) throws IOException
skip
in class InputStream
IOException
public int available() throws IOException
available
in class InputStream
IOException
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
close
in class InputStream
IOException
public void mark(int limit)
mark
in class InputStream
public void reset()
reset
in class InputStream
public boolean markSupported()
markSupported
in class InputStream
Copyright © 2015. All rights reserved.