Documentation
¶
Index ¶
- Constants
- func GetDecompressedSizeLegacy(src []byte) uint64
- func IsLegacy(src []byte) uint32
- type DCtx
- func (dc *DCtx) Decompress(dst, src []byte) (int, ErrorCode)
- func (dc *DCtx) DecompressStream(out, in []byte, inPos int) (int, int, uint64, ErrorCode)
- func (dc *DCtx) DecompressUsingDDict(dst, src []byte, d *DDict) (int, ErrorCode)
- func (dc *DCtx) DecompressUsingDict(dst, src, dict []byte) (int, ErrorCode)
- func (dc *DCtx) RefDDict(d *DDict) ErrorCode
- func (dc *DCtx) ResetSession()
- type DDict
- type DictContentType
- type ErrorCode
- type LegacyStream
Constants ¶
const ContentSizeError = lContentSizeError
ContentSizeError is ZSTD_CONTENTSIZE_ERROR, the decompressed bound of a frame that could not be sized
Variables ¶
This section is empty.
Functions ¶
func GetDecompressedSizeLegacy ¶
GetDecompressedSizeLegacy is the content size a legacy frame header declares, zero when it declares none
Types ¶
type DCtx ¶
type DCtx struct {
// contains filtered or unexported fields
}
DCtx is a ZSTD_DCtx and ZSTD_DStream of libzstd 1.5.7 built for x86-64 with BMI2 and legacy support from v0.5
func NewDStream ¶
func NewDStream() *DCtx
NewDStream is ZSTD_createDStream, a decoder with default parameters waiting for a frame
func (*DCtx) Decompress ¶
Decompress is ZSTD_decompressDCtx of src into dst with the referenced dictionary, the size decoded
func (*DCtx) DecompressStream ¶
DecompressStream is ZSTD_decompressStream over out and in from inPos, the bytes written, input position and hint
func (*DCtx) DecompressUsingDDict ¶
DecompressUsingDDict is ZSTD_decompress_usingDDict of src into dst, the size decoded
func (*DCtx) DecompressUsingDict ¶
DecompressUsingDict is ZSTD_decompress_usingDict of src into dst, the size decoded
func (*DCtx) ResetSession ¶
func (dc *DCtx) ResetSession()
ResetSession is ZSTD_DCtx_reset with ZSTD_reset_session_only
type DDict ¶
type DDict struct {
// contains filtered or unexported fields
}
DDict is a ZSTD_DDict, a dictionary with its entropy tables digested
type DictContentType ¶
type DictContentType int
DictContentType is ZSTD_dictContentType_e
const ( DictContentAuto DictContentType = iota DictContentRaw DictContentFull )
ZSTD_dct_auto, ZSTD_dct_rawContent and ZSTD_dct_fullDict
type ErrorCode ¶
type ErrorCode int
ErrorCode is a ZSTD_ErrorCode, zero when nothing failed
const ( ErrGeneric ErrorCode = 1 ErrPrefixUnknown ErrorCode = 10 ErrVersionUnsupported ErrorCode = 12 ErrFrameParameterUnsupport ErrorCode = 14 ErrWindowTooLarge ErrorCode = 16 ErrCorruptionDetected ErrorCode = 20 ErrChecksumWrong ErrorCode = 22 ErrLiteralsHeaderWrong ErrorCode = 24 ErrDictionaryCorrupted ErrorCode = 30 ErrDictionaryWrong ErrorCode = 32 ErrTableLogTooLarge ErrorCode = 44 ErrMaxSymbolValueTooLarge ErrorCode = 46 ErrMaxSymbolValueTooSmall ErrorCode = 48 ErrStageWrong ErrorCode = 60 ErrInitMissing ErrorCode = 62 ErrMemoryAllocation ErrorCode = 64 ErrDstSizeTooSmall ErrorCode = 70 ErrSrcSizeWrong ErrorCode = 72 ErrNoForwardProgressDestFull ErrorCode = 80 ErrNoForwardProgressInputEmpty ErrorCode = 82 )
ZSTD_ErrorCode values the decoders raise
func DecompressLegacy ¶
DecompressLegacy decodes one whole legacy frame with an optional dictionary into dst and returns the bytes written
func FindFrameCompressedSize ¶
FindFrameCompressedSize is ZSTD_findFrameCompressedSize, the compressed size of the frame starting src
type LegacyStream ¶
type LegacyStream struct {
// contains filtered or unexported fields
}
LegacyStream is the buffered decoder ZSTD_initLegacyStream keeps for one legacy format version
func InitLegacyStream ¶
func InitLegacyStream(prev *LegacyStream, prevVersion, newVersion uint32, dict []byte) *LegacyStream
InitLegacyStream readies the stream decoder of newVersion with dict, reusing prev when the version did not change
func (*LegacyStream) Decompress ¶
func (s *LegacyStream) Decompress(version uint32, out, in []byte) (written, read int, hint uint64, e ErrorCode)
Decompress runs ZSTD_decompressLegacyStream, the bytes written to out and read from in then the next input hint