SnappyFramedOutputStream
which implements
the standard x-snappy-framed
specification.@Deprecated public class SnappyOutputStream extends AbstractSnappyOutputStream
((crc >>> 15) | (crc << 17)) + 0xa282ead8
An uncompressed block is simply copied from the input, thus guaranteeing
that the output is never larger than the input (not including the header).
NOTE:This data produced by this class is not compatible with the
x-snappy-framed
specification. It can only be read by
SnappyInputStream
.
Modifier and Type | Field and Description |
---|---|
private boolean |
calculateChecksum
Deprecated.
|
(package private) static int |
MAX_BLOCK_SIZE
Deprecated.
|
static double |
MIN_COMPRESSION_RATIO
Deprecated.
Write out the uncompressed content if the compression ratio (compressed length / raw length) exceeds this value.
|
(package private) static byte[] |
STREAM_HEADER
Deprecated.
|
Modifier | Constructor and Description |
---|---|
|
SnappyOutputStream(java.io.OutputStream out)
Deprecated.
Creates a Snappy output stream to write data to the specified underlying output stream.
|
private |
SnappyOutputStream(java.io.OutputStream out,
boolean calculateChecksum)
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
protected int |
calculateCRC32C(byte[] data,
int offset,
int length)
Deprecated.
Calculates a CRC32C checksum over the data.
|
static SnappyOutputStream |
newChecksumFreeBenchmarkOutputStream(java.io.OutputStream out)
Deprecated.
Creates a Snappy output stream with block checksums disabled.
|
protected void |
writeBlock(java.io.OutputStream out,
byte[] data,
int offset,
int length,
boolean compressed,
int crc32c)
Deprecated.
Write a frame (block) to out.
|
protected void |
writeHeader(java.io.OutputStream out)
Deprecated.
Writes the implementation specific header or "marker bytes" to
out.
|
close, flush, write, write
static final byte[] STREAM_HEADER
static final int MAX_BLOCK_SIZE
public static final double MIN_COMPRESSION_RATIO
private final boolean calculateChecksum
public SnappyOutputStream(java.io.OutputStream out) throws java.io.IOException
out
- the underlying output streamjava.io.IOException
private SnappyOutputStream(java.io.OutputStream out, boolean calculateChecksum) throws java.io.IOException
java.io.IOException
public static SnappyOutputStream newChecksumFreeBenchmarkOutputStream(java.io.OutputStream out) throws java.io.IOException
out
- the underlying output streamjava.io.IOException
protected void writeHeader(java.io.OutputStream out) throws java.io.IOException
AbstractSnappyOutputStream
writeHeader
in class AbstractSnappyOutputStream
out
- The underlying OutputStream
.java.io.IOException
protected int calculateCRC32C(byte[] data, int offset, int length)
AbstractSnappyOutputStream
This can be overridden to provider alternative implementations (such as returning 0 if checksums are not desired).
calculateCRC32C
in class AbstractSnappyOutputStream
protected void writeBlock(java.io.OutputStream out, byte[] data, int offset, int length, boolean compressed, int crc32c) throws java.io.IOException
AbstractSnappyOutputStream
writeBlock
in class AbstractSnappyOutputStream
out
- The OutputStream
to write to.data
- The data to write.offset
- The offset in data to start at.length
- The length of data to use.compressed
- Indicates if data is the compressed or raw content.
This is based on whether the compression ratio desired is
reached.crc32c
- The calculated checksum.java.io.IOException