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