Documentation
¶
Overview ¶
Package decoder implements pure Go chunk decoders independently of storage, worker protocols, and the corresponding encoders.
Index ¶
Constants ¶
const MaxGzipFastSize = 16 << 20
MaxGzipFastSize bounds speculative output allocation, including corrupt ISIZE fields. Larger chunks still decode through the general streaming path.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Decoder ¶
type Decoder interface {
Name() string
Decode(ctx context.Context, src io.Reader, dst io.Writer) error
}
Decoder restores one stored chunk. Its name describes the wire format, independently of whether CPU or FPGA hardware originally encoded the chunk.
type Gzip ¶
type Gzip struct{}
Gzip decodes standard gzip, using a bounded fixed-Huffman fast path for complete chunks and the general pure Go decoder for other streams.
func (Gzip) Decode ¶
Decode decodes a gzip reader. bytes.Reader and bytes.Buffer expose a complete chunk to DecodeBytes through WriteTo without copying their backing slice. Other readers use the general streaming decoder, with no whole-input buffering.
func (Gzip) DecodeBytes ¶
DecodeBytes decodes a complete gzip byte slice. It accepts concatenated members, optional headers, and all standard DEFLATE block types. The fast path never publishes bytes until the entire member's size and CRC have been verified. Callers must not modify encoded during the call.
type LZ4 ¶
type LZ4 struct{}
LZ4 accepts standard independent-block frames, including the FPGA profile's checksummed frames and uncompressed-block fallback.
type MinLZ ¶
type MinLZ struct{}
MinLZ restores independent checksummed streams from CPU or FPGA encoders.