Documentation ¶
Overview ¶
Package lz4stream provides the types that support reading and writing LZ4 data streams.
Index ¶
- type Blocks
- type DataBlockSize
- type DescriptorFlags
- func (x DescriptorFlags) BlockChecksum() bool
- func (x *DescriptorFlags) BlockChecksumSet(v bool) *DescriptorFlags
- func (x DescriptorFlags) BlockIndependence() bool
- func (x *DescriptorFlags) BlockIndependenceSet(v bool) *DescriptorFlags
- func (x DescriptorFlags) BlockSizeIndex() lz4block.BlockSizeIndex
- func (x *DescriptorFlags) BlockSizeIndexSet(v lz4block.BlockSizeIndex) *DescriptorFlags
- func (x DescriptorFlags) ContentChecksum() bool
- func (x *DescriptorFlags) ContentChecksumSet(v bool) *DescriptorFlags
- func (x DescriptorFlags) Size() bool
- func (x *DescriptorFlags) SizeSet(v bool) *DescriptorFlags
- func (x DescriptorFlags) Version() uint16
- func (x *DescriptorFlags) VersionSet(v uint16) *DescriptorFlags
- type Frame
- func (f *Frame) CloseR(src io.Reader) (err error)
- func (f *Frame) CloseW(dst io.Writer, num int) error
- func (f *Frame) InitR(src io.Reader, num int) (chan []byte, error)
- func (f *Frame) InitW(dst io.Writer, num int, legacy bool)
- func (f *Frame) ParseHeaders(src io.Reader) error
- func (f *Frame) Reset(num int)
- type FrameDataBlock
- func (b *FrameDataBlock) Close(f *Frame)
- func (b *FrameDataBlock) Compress(f *Frame, src []byte, level lz4block.CompressionLevel) *FrameDataBlock
- func (b *FrameDataBlock) Read(f *Frame, src io.Reader, cum uint32) (uint32, error)
- func (b *FrameDataBlock) Uncompress(f *Frame, dst, dict []byte, sum bool) ([]byte, error)
- func (b *FrameDataBlock) Write(f *Frame, dst io.Writer) error
- type FrameDescriptor
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Blocks ¶
type Blocks struct { Block *FrameDataBlock Blocks chan chan *FrameDataBlock // contains filtered or unexported fields }
type DataBlockSize ¶
type DataBlockSize uint32
DataBlockSize is defined as follow:
field bits ----- ---- size 31 Uncompressed 1
func (DataBlockSize) Uncompressed ¶
func (x DataBlockSize) Uncompressed() bool
func (*DataBlockSize) UncompressedSet ¶
func (x *DataBlockSize) UncompressedSet(v bool) *DataBlockSize
type DescriptorFlags ¶
type DescriptorFlags uint16
DescriptorFlags is defined as follow:
field bits ----- ---- _ 2 ContentChecksum 1 Size 1 BlockChecksum 1 BlockIndependence 1 Version 2 _ 4 BlockSizeIndex 3 _ 1
func (DescriptorFlags) BlockChecksum ¶
func (x DescriptorFlags) BlockChecksum() bool
func (*DescriptorFlags) BlockChecksumSet ¶
func (x *DescriptorFlags) BlockChecksumSet(v bool) *DescriptorFlags
func (DescriptorFlags) BlockIndependence ¶
func (x DescriptorFlags) BlockIndependence() bool
func (*DescriptorFlags) BlockIndependenceSet ¶
func (x *DescriptorFlags) BlockIndependenceSet(v bool) *DescriptorFlags
func (DescriptorFlags) BlockSizeIndex ¶
func (x DescriptorFlags) BlockSizeIndex() lz4block.BlockSizeIndex
func (*DescriptorFlags) BlockSizeIndexSet ¶
func (x *DescriptorFlags) BlockSizeIndexSet(v lz4block.BlockSizeIndex) *DescriptorFlags
func (*DescriptorFlags) ContentChecksumSet ¶
func (x *DescriptorFlags) ContentChecksumSet(v bool) *DescriptorFlags
Setters.
func (DescriptorFlags) Size ¶
func (x DescriptorFlags) Size() bool
func (*DescriptorFlags) SizeSet ¶
func (x *DescriptorFlags) SizeSet(v bool) *DescriptorFlags
func (DescriptorFlags) Version ¶
func (x DescriptorFlags) Version() uint16
func (*DescriptorFlags) VersionSet ¶
func (x *DescriptorFlags) VersionSet(v uint16) *DescriptorFlags
type Frame ¶
type Frame struct { Magic uint32 Descriptor FrameDescriptor Blocks Blocks Checksum uint32 // contains filtered or unexported fields }
type FrameDataBlock ¶
type FrameDataBlock struct { Size DataBlockSize Data []byte // compressed or uncompressed data (.data or .src) Checksum uint32 // contains filtered or unexported fields }
func NewFrameDataBlock ¶
func NewFrameDataBlock(f *Frame) *FrameDataBlock
func (*FrameDataBlock) Close ¶ added in v4.1.1
func (b *FrameDataBlock) Close(f *Frame)
func (*FrameDataBlock) Compress ¶
func (b *FrameDataBlock) Compress(f *Frame, src []byte, level lz4block.CompressionLevel) *FrameDataBlock
Block compression errors are ignored since the buffer is sized appropriately.
func (*FrameDataBlock) Read ¶ added in v4.1.1
Read updates b with the next block data, size and checksum if available.
func (*FrameDataBlock) Uncompress ¶
type FrameDescriptor ¶
type FrameDescriptor struct { Flags DescriptorFlags ContentSize uint64 Checksum uint8 }
Click to show internal directories.
Click to hide internal directories.