public class SnappyOutputStream
extends java.io.OutputStream
OutputStream.
The output data format is:
SnappyCodec
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.| Modifier and Type | Field and Description |
|---|---|
protected byte[] |
compressed |
protected java.io.OutputStream |
out |
protected byte[] |
uncompressed |
| Constructor and Description |
|---|
SnappyOutputStream(java.io.OutputStream out) |
SnappyOutputStream(java.io.OutputStream out,
int blockSize) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
protected void |
dump() |
void |
flush() |
void |
rawWrite(java.lang.Object array,
int byteOffset,
int byteLength)
Compress the raw byte array data.
|
void |
write(byte[] b,
int off,
int len) |
void |
write(double[] f) |
void |
write(double[] f,
int off,
int len) |
void |
write(float[] f) |
void |
write(float[] f,
int off,
int len) |
void |
write(int b) |
void |
write(int[] f) |
void |
write(int[] f,
int off,
int len) |
void |
write(long[] d) |
void |
write(long[] d,
int off,
int len)
Compress the input long array data
|
void |
write(short[] f) |
void |
write(short[] f,
int off,
int len) |
protected void |
writeHeader() |
protected final java.io.OutputStream out
protected byte[] uncompressed
protected byte[] compressed
public SnappyOutputStream(java.io.OutputStream out)
throws java.io.IOException
java.io.IOExceptionpublic SnappyOutputStream(java.io.OutputStream out,
int blockSize)
throws java.io.IOException
java.io.IOExceptionprotected void writeHeader()
throws java.io.IOException
java.io.IOExceptionpublic void write(byte[] b,
int off,
int len)
throws java.io.IOException
write in class java.io.OutputStreamjava.io.IOExceptionpublic void write(long[] d,
int off,
int len)
throws java.io.IOException
d - input arrayoff - offset in the arraylen - the number of elements in the array to copyjava.io.IOExceptionpublic void write(double[] f,
int off,
int len)
throws java.io.IOException
java.io.IOExceptionpublic void write(float[] f,
int off,
int len)
throws java.io.IOException
java.io.IOExceptionpublic void write(int[] f,
int off,
int len)
throws java.io.IOException
java.io.IOExceptionpublic void write(short[] f,
int off,
int len)
throws java.io.IOException
java.io.IOExceptionpublic void write(long[] d)
throws java.io.IOException
java.io.IOExceptionpublic void write(double[] f)
throws java.io.IOException
java.io.IOExceptionpublic void write(float[] f)
throws java.io.IOException
java.io.IOExceptionpublic void write(int[] f)
throws java.io.IOException
java.io.IOExceptionpublic void write(short[] f)
throws java.io.IOException
java.io.IOExceptionpublic void rawWrite(java.lang.Object array,
int byteOffset,
int byteLength)
throws java.io.IOException
array - array data of any type (e.g., byte[], float[], long[], ...)byteOffset - byteLength - java.io.IOExceptionpublic void write(int b)
throws java.io.IOException
write in class java.io.OutputStreamjava.io.IOExceptionpublic void flush()
throws java.io.IOException
flush in interface java.io.Flushableflush in class java.io.OutputStreamjava.io.IOExceptionprotected void dump()
throws java.io.IOException
java.io.IOExceptionpublic void close()
throws java.io.IOException
close in interface java.io.Closeableclose in interface java.lang.AutoCloseableclose in class java.io.OutputStreamjava.io.IOExceptionCopyright © 2023. All Rights Reserved.