This class implements an output stream for writing Snappy compressed data. The output format is the stream header "snappy\0" followed by one or more compressed blocks of data, each of which is preceded by a seven byte header.
The first byte of the header is a flag indicating if the block is compressed or not. A value of 0x00 means uncompressed, and 0x01 means compressed.
The second and third bytes are the size of the block in the stream as a big endian number. This value is never zero as empty blocks are never written. The maximum allowed length is 32k (1 << 15).
The remaining four byes are crc32c checksum of the user input data masked with the following function: {@code ((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).