Documentation
¶
Index ¶
Constants ¶
View Source
const ( IndexHeader = "s2idx\x00" IndexTrailer = "\x00xdi2s" MaxIndexEntries = 1 << 16 )
View Source
const ( ChunkLegacyCompressed = 0x00 ChunkUncompressed = 0x01 ChunkMinLZBlock = 0x02 ChunkMinLZCompCRC = 0x03 ChunkIndex = 0x40 ChunkEOF = 0x20 ChunkPadding = 0xfe ChunkStreamID = 0xff )
Variables ¶
This section is empty.
Functions ¶
func DecodeBlock ¶
DecodeBlock is a reference implementation of the MinLZ block decoder. This implementation is not optimized for speed, but for readability with no dependencies.
func EncodeBlock ¶
EncodeBlock is a reference implementation of the MinLZ block decoder. This implementation is not optimized for speed nor efficiency, but for readability with no dependencies. See 'encodeBlockGo' for a more optimal encoder.
func MaxEncodedLen ¶
MaxEncodedLen returns the maximum length of a snappy block, given its uncompressed length.
It will return a negative value if srcLen is too large to encode.
Types ¶
type Index ¶
type Index struct { TotalUncompressed int64 // Total Uncompressed size. TotalCompressed int64 // Total Compressed size if known. Will be -1 if unknown. // Compressed -> Uncompressed map of block start positions. // Not all blocks will be in here Blocks []struct { CompressedOffset int64 UncompressedOffset int64 } // contains filtered or unexported fields }
Index represents a MinLZ index.
func LoadIndexAfterHeader ¶
LoadIndexAfterHeader will load and parse an index, after the stream header has been parsed.
Click to show internal directories.
Click to hide internal directories.