|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.io.OutputStream
org.xerial.snappy.SnappyOutputStream
public class SnappyOutputStream
This class implements a stream filter for writing compressed data using
Snappy.
The input data is blocked into 32kb size (in default), and each block is
compressed and then passed to the given OutputStream
.
The output data format is:
SnappyCodec
(8 bytes)
SnappyOutputStream
cannot be
uncompressed by Snappy.uncompress(byte[])
since the output formats of
Snappy.compress(byte[])
and SnappyOutputStream
are different.
Use SnappyInputStream
for uncompress the data generated by
SnappyOutputStream
.
Constructor Summary | |
---|---|
SnappyOutputStream(OutputStream out)
|
|
SnappyOutputStream(OutputStream out,
int blockSize)
|
Method Summary | |
---|---|
void |
close()
close the stream |
void |
flush()
|
void |
rawWrite(Object array,
int byteOffset,
int byteLength)
Compress the raw byte array data. |
void |
write(byte[] b,
int off,
int len)
Writes len bytes from the specified byte array starting at offset off to this output stream. |
void |
write(double[] f)
Compress the input array data |
void |
write(double[] f,
int off,
int len)
Compress the input double array data |
void |
write(float[] f)
Compress the input array data |
void |
write(float[] f,
int off,
int len)
Compress the input float array data |
void |
write(int b)
Writes the specified byte to this output stream. |
void |
write(int[] f)
Compress the input array data |
void |
write(int[] f,
int off,
int len)
Compress the input int array data |
void |
write(long[] d)
Compress the input array data |
void |
write(long[] d,
int off,
int len)
Compress the input long array data |
void |
write(short[] f)
Compress the input array data |
void |
write(short[] f,
int off,
int len)
Compress the input short array data |
Methods inherited from class java.io.OutputStream |
---|
write |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SnappyOutputStream(OutputStream out) throws IOException
IOException
public SnappyOutputStream(OutputStream out, int blockSize) throws IOException
out
- blockSize
- byte size of the internal buffer size
IOException
Method Detail |
---|
public void write(byte[] b, int off, int len) throws IOException
write
in class OutputStream
IOException
public void write(long[] d, int off, int len) throws IOException
d
- input arrayoff
- offset in the arraylen
- the number of elements in the array to copy
IOException
public void write(double[] f, int off, int len) throws IOException
f
- input arrayoff
- offset in the arraylen
- the number of elements in the array to copy
IOException
public void write(float[] f, int off, int len) throws IOException
f
- input arrayoff
- offset in the arraylen
- the number of elements in the array to copy
IOException
public void write(int[] f, int off, int len) throws IOException
f
- input arrayoff
- offset in the arraylen
- the number of elements in the array to copy
IOException
public void write(short[] f, int off, int len) throws IOException
f
- input arrayoff
- offset in the arraylen
- the number of elements in the array to copy
IOException
public void write(long[] d) throws IOException
d
-
IOException
public void write(double[] f) throws IOException
f
-
IOException
public void write(float[] f) throws IOException
f
-
IOException
public void write(int[] f) throws IOException
f
-
IOException
public void write(short[] f) throws IOException
f
-
IOException
public void rawWrite(Object array, int byteOffset, int byteLength) throws IOException
array
- array data of any type (e.g., byte[], float[], long[], ...)byteOffset
- byteLength
-
IOException
public void write(int b) throws IOException
write
in class OutputStream
IOException
public void flush() throws IOException
flush
in interface Flushable
flush
in class OutputStream
IOException
public void close() throws IOException
close
in interface Closeable
close
in class OutputStream
IOException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |