public class SnappyInputStream
extends java.io.InputStream
SnappyOutputStream
.Modifier and Type | Field and Description |
---|---|
private byte[] |
compressed |
private boolean |
finishedReading |
private byte[] |
header |
protected java.io.InputStream |
in |
private byte[] |
uncompressed |
private int |
uncompressedCursor |
private int |
uncompressedLimit |
Constructor and Description |
---|
SnappyInputStream(java.io.InputStream input)
Create a filter for reading compressed data as a uncompressed stream
|
Modifier and Type | Method and Description |
---|---|
int |
available() |
void |
close()
Close the stream
|
protected boolean |
hasNextChunk() |
private static boolean |
isValidHeader(byte[] header) |
int |
rawRead(java.lang.Object array,
int byteOffset,
int byteLength)
Read uncompressed data into the specified array
|
int |
read()
Reads the next byte of uncompressed data from the input stream.
|
int |
read(byte[] b,
int byteOffset,
int byteLength)
Reads up to len bytes of data from the input stream into an array of
bytes.
|
int |
read(double[] d)
Read double array from the stream
|
int |
read(double[] d,
int off,
int len)
Read double array from the stream
|
int |
read(float[] d)
Read float array from the stream
|
int |
read(float[] d,
int off,
int len)
Read float array from the stream
|
int |
read(int[] d)
Read int array from the stream
|
int |
read(int[] d,
int off,
int len)
Read int array from the stream
|
int |
read(long[] d)
Read long array from the stream
|
int |
read(long[] d,
int off,
int len)
Read long array from the stream
|
int |
read(short[] d)
Read short array from the stream
|
int |
read(short[] d,
int off,
int len)
Read short array from the stream
|
protected void |
readFully(byte[] fragment,
int fragmentLength) |
protected void |
readHeader() |
private int |
readNext(byte[] dest,
int offset,
int len)
Read next len bytes
|
private boolean finishedReading
protected final java.io.InputStream in
private byte[] compressed
private byte[] uncompressed
private int uncompressedCursor
private int uncompressedLimit
private byte[] header
public SnappyInputStream(java.io.InputStream input) throws java.io.IOException
input
- 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
protected void readHeader() throws java.io.IOException
java.io.IOException
private static boolean isValidHeader(byte[] header) throws java.io.IOException
java.io.IOException
protected void readFully(byte[] fragment, int fragmentLength) throws java.io.IOException
java.io.IOException
public int read(byte[] b, int byteOffset, int byteLength) throws java.io.IOException
read
in class java.io.InputStream
java.io.IOException
public int rawRead(java.lang.Object array, int byteOffset, int byteLength) throws java.io.IOException
array
- byteOffset
- byteLength
- java.io.IOException
public int read(long[] d, int off, int len) throws java.io.IOException
d
- inputoff
- offsetlen
- the number of long elements to readjava.io.IOException
public int read(long[] d) throws java.io.IOException
d
- java.io.IOException
public int read(double[] d, int off, int len) throws java.io.IOException
d
- inputoff
- offsetlen
- the number of double elements to readjava.io.IOException
public int read(double[] d) throws java.io.IOException
d
- java.io.IOException
public int read(int[] d) throws java.io.IOException
d
- java.io.IOException
public int read(int[] d, int off, int len) throws java.io.IOException
d
- inputoff
- offsetlen
- the number of int elements to readjava.io.IOException
public int read(float[] d, int off, int len) throws java.io.IOException
d
- inputoff
- offsetlen
- the number of float elements to readjava.io.IOException
public int read(float[] d) throws java.io.IOException
d
- java.io.IOException
public int read(short[] d, int off, int len) throws java.io.IOException
d
- inputoff
- offsetlen
- the number of short elements to readjava.io.IOException
public int read(short[] d) throws java.io.IOException
d
- java.io.IOException
private int readNext(byte[] dest, int offset, int len) throws java.io.IOException
dest
- offset
- len
- java.io.IOException
protected boolean hasNextChunk() 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 available() throws java.io.IOException
available
in class java.io.InputStream
java.io.IOException