public class RandomCompressedInputStream
extends java.io.InputStream
RandomCompressedOutputStream
. The underlying stream should be
seekable and the total size of it should be known because the lookup table
that helps doing the random access is stored at the very end.Constructor and Description |
---|
RandomCompressedInputStream(FileSystem fs,
Path p) |
RandomCompressedInputStream(FSDataInputStream in,
long totalLength) |
Modifier and Type | Method and Description |
---|---|
int |
available() |
void |
close() |
long |
getPos() |
int |
read() |
int |
read(long position,
byte[] buffer,
int offset,
int length) |
void |
readFully(long position,
byte[] buffer) |
void |
readFully(long position,
byte[] buffer,
int offset,
int length) |
void |
seek(long newPos) |
boolean |
seekToNewSource(long newPos) |
long |
skip(long n) |
public RandomCompressedInputStream(FileSystem fs, Path p) throws java.io.IOException
java.io.IOException
public RandomCompressedInputStream(FSDataInputStream in, long totalLength) throws java.io.IOException
java.io.IOException
public long getPos() throws java.io.IOException
java.io.IOException
public void seek(long newPos) throws java.io.IOException
java.io.IOException
public boolean seekToNewSource(long newPos) throws java.io.IOException
java.io.IOException
public int read() 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 void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
close
in class java.io.InputStream
java.io.IOException
public int read(long position, byte[] buffer, int offset, int length) throws java.io.IOException
java.io.IOException
public void readFully(long position, byte[] buffer, int offset, int length) throws java.io.IOException
java.io.IOException
public void readFully(long position, byte[] buffer) throws java.io.IOException
java.io.IOException
public int available() throws java.io.IOException
available
in class java.io.InputStream
java.io.IOException