flate

package module
v0.1.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 10, 2021 License: BSD-2-Clause Imports: 24 Imported by: 0

README

flate

Go Latest Release Go Reference License Go Report Card

Implementation of DEFLATE, zlib, and gzip with advanced configuration options.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BlockEvent

type BlockEvent struct {
	Type    BlockType
	IsFinal bool
}

BlockEvent is a sub-struct that is only present for BlockFooEvent.

type BlockType

type BlockType byte

BlockType indicates the type of a DEFLATE-compressed block.

const (
	// InvalidBlock is a dummy value indicating an invalid block.
	InvalidBlock BlockType = iota

	// StoredBlock indicates a stored (uncompressed) block.
	StoredBlock

	// StaticBlock indicates a Huffman-compressed block that uses the
	// static (pre-defined) Huffman encoding.
	StaticBlock

	// DynamicBlock indicates a Huffman-compressed block that uses a
	// dynamic Huffman encoding produced just for this block.
	DynamicBlock
)

func (BlockType) GoString

func (b BlockType) GoString() string

GoString returns the Go string representation of this BlockType constant.

func (BlockType) MarshalJSON

func (b BlockType) MarshalJSON() ([]byte, error)

MarshalJSON returns the JSON representation of this BlockType constant.

func (BlockType) String

func (b BlockType) String() string

String returns the string representation of this BlockType constant.

type Checksum32

type Checksum32 uint32

Checksum32 is a lightweight wrapper around uint32 that is used for 32-bit checksums, such as CRC-32 or Adler-32. It stringifies to hexadecimal format.

func (Checksum32) GoString

func (csum Checksum32) GoString() string

GoString returns the Go string representation of this Checksum32 value.

func (Checksum32) MarshalJSON

func (csum Checksum32) MarshalJSON() ([]byte, error)

MarshalJSON returns the JSON representation of this Checksum32 value.

func (Checksum32) String

func (csum Checksum32) String() string

String returns the string representation of this Checksum32 value.

func (*Checksum32) UnmarshalJSON

func (csum *Checksum32) UnmarshalJSON(raw []byte) error

UnmarshalJSON parses the JSON representation of a Checksum32 value.

type CompressLevel

type CompressLevel int8

CompressLevel indicates the desired effort / CPU time to expend in finding an optimal compression stream.

const (
	// DefaultCompression requests that the default value for CompressLevel
	// be selected.  This is currently equivalent to 6.
	DefaultCompression CompressLevel = -1

	// NoCompression requests that the data be stored literally, rather
	// than compressed.
	NoCompression CompressLevel = 0

	// FastestCompression requests that the data be compressed with the
	// greatest speed and least effort.
	FastestCompression CompressLevel = 1

	// BestCompression requests that the data be compressed with the
	// greatest effort and least speed.
	BestCompression CompressLevel = 9
)

func (CompressLevel) GoString

func (clevel CompressLevel) GoString() string

GoString returns the Go string representation of this CompressLevel constant.

func (CompressLevel) IsValid

func (clevel CompressLevel) IsValid() bool

IsValid returns true if clevel is a valid CompressLevel constant.

func (CompressLevel) MarshalJSON

func (clevel CompressLevel) MarshalJSON() ([]byte, error)

MarshalJSON returns the JSON representation of this CompressLevel constant.

func (*CompressLevel) Parse

func (clevel *CompressLevel) Parse(str string) error

Parse parses a string representation of a CompressLevel constant.

func (CompressLevel) String

func (clevel CompressLevel) String() string

String returns the string representation of this CompressLevel constant.

type CorruptInputError

type CorruptInputError struct {
	OffsetTotal  uint64
	OffsetStream uint64
	Problem      string
}

CorruptInputError is returned when the stream being decompressed contains data that violates the compression format standard.

func (CorruptInputError) Error

func (err CorruptInputError) Error() string

Error fulfills the error interface.

type DataType

type DataType byte

DataType indicates the autodetected content type of the compressed data, text (ASCII-compatible, including ISO-8859-1 or UTF-8) vs binary (anything else).

const (
	// UnknownData indicates that autodetection was not performed.
	UnknownData DataType = iota

	// BinaryData indicates that autodetection found non-textual data.
	BinaryData

	// TextData indicates that autodetection found textual data.
	TextData
)

func (DataType) GoString

func (d DataType) GoString() string

GoString returns the Go string representation of this DataType constant.

func (DataType) IsValid

func (d DataType) IsValid() bool

IsValid returns true if d is a valid DataType constant.

func (DataType) MarshalJSON

func (d DataType) MarshalJSON() ([]byte, error)

MarshalJSON returns the JSON representation of this DataType constant.

func (DataType) String

func (d DataType) String() string

String returns the string representation of this DataType constant.

type Event

type Event struct {
	Type              EventType
	InputBytesTotal   uint64
	InputBytesStream  uint64
	OutputBytesTotal  uint64
	OutputBytesStream uint64
	NumStreams        uint
	Format            Format
	Header            *Header
	Block             *BlockEvent
	Trees             *TreesEvent
	Footer            *FooterEvent
}

Event is a collection of fields that provide feedback on the progress of the compression or decompression operation in progress. Events are provided to Tracers registered with a Reader or Writer.

type EventType

type EventType byte

EventType indicates the type of an Event.

const (
	// StreamBeginEvent indicates that the beginning of a compressed stream
	// was detected.
	StreamBeginEvent EventType = iota

	// StreamHeaderEvent indicates that the stream header was successfully
	// processed.
	StreamHeaderEvent

	// BlockBeginEvent indicates that a block was detected.
	BlockBeginEvent

	// BlockTreesEvent indicates that the Huffman tree metadata for the
	// current block have been successfully processed.
	BlockTreesEvent

	// BlockEndEvent indicates that the data for the current block has been
	// successfully processed.
	BlockEndEvent

	// StreamEndEvent indicates that the end of the current stream was
	// detected.
	StreamEndEvent

	// StreamCloseEvent indicates that the stream footer was successfully
	// processed.
	StreamCloseEvent
)

func (EventType) GoString

func (e EventType) GoString() string

GoString returns the Go string representation of this EventType constant.

func (EventType) MarshalJSON

func (e EventType) MarshalJSON() ([]byte, error)

MarshalJSON returns the JSON representation of this EventType constant.

func (EventType) String

func (e EventType) String() string

String returns the string representation of this EventType constant.

type ExtraData

type ExtraData struct {
	Records []ExtraDataRecord
}

ExtraData represents a collection of records in a gzip ExtraData header.

func (*ExtraData) AsBytes

func (xd *ExtraData) AsBytes() []byte

AsBytes returns the binary representation of this ExtraData field.

func (*ExtraData) Parse

func (xd *ExtraData) Parse(raw []byte)

Parse parses the given bytes as an ExtraData field.

type ExtraDataRecord

type ExtraDataRecord struct {
	ID    [2]byte
	Bytes []byte
}

ExtraDataRecord represents a single record in a gzip ExtraData header.

type FlushType

type FlushType byte

FlushType indicates which type of Flush() operation is to be performed.

const (
	// BlockFlush completes the current block.  Some bits of the current
	// block may remain un-flushed in memory after this Flush().
	//
	// BlockFlush can impact your compression ratio by forcing the
	// premature end of the current block.
	//
	BlockFlush FlushType = iota

	// PartialFlush completes the current block and writes an empty
	// static-tree Huffman block (10 bits) as padding.  As the empty block
	// is more than 8 bits, all bits of the current block are guaranteed to
	// reach the underlying io.Writer by the completion of this Flush().
	//
	// Like BlockFlush, PartialFlush can impact your compression ratio.
	//
	PartialFlush

	// SyncFlush completes the current block and writes an empty
	// uncompressed block (35+ bits).  In addition to the guarantees made
	// by PartialFlush, this also guarantees that the next block will start
	// on a byte boundary.
	//
	// Like BlockFlush, SyncFlush can impact your compression ratio.
	//
	SyncFlush

	// FullFlush completes the current block, writes an empty uncompressed
	// block (35+ bits), and forgets the current sliding window.  In
	// addition to the guarantees made by PartialFlush and SyncFlush, this
	// also allows the stream reader to begin decompression at the start of
	// the next block without looking at any previous data.
	//
	// FullFlush will seriously degrade your compression ratio if not used
	// wisely, far more than BlockFlush would.
	//
	FullFlush

	// FinishFlush completes the current block, writes an empty
	// uncompressed block (35+ bits) that is marked BFINAL=1, writes the
	// footers for the current file format (if any), and forgets the
	// current sliding window.
	//
	// Any data written after this will begin a new concatenated stream.
	// Most users will want to call Close() instead.
	FinishFlush
)

func (FlushType) GoString

func (f FlushType) GoString() string

GoString returns the Go string representation of this FlushType constant.

func (FlushType) IsValid

func (f FlushType) IsValid() bool

IsValid returns true if f is a valid FlushType constant.

func (FlushType) MarshalJSON

func (f FlushType) MarshalJSON() ([]byte, error)

MarshalJSON returns the JSON representation of this FlushType constant.

func (FlushType) String

func (f FlushType) String() string

String returns the string representation of this FlushType constant.

type FooterEvent

type FooterEvent struct {
	Adler32 Checksum32
	CRC32   Checksum32
}

FooterEvent is a sub-struct that is only present for StreamEndEvent.

type Format

type Format byte

Format indicates the file format to be written (Writer) or expected to be read (Reader).

const (
	// DefaultFormat requests that Reader autodetect the file format, and
	// requests that Writer use the default format (currently ZlibFormat).
	DefaultFormat Format = iota

	// RawFormat indicates that a raw DEFLATE stream is in use, with no
	// headers or footers.
	RawFormat

	// ZlibFormat indicates that a zlib stream (RFC 1950) is in use.
	ZlibFormat

	// GZIPFormat indicates that a gzip stream (RFC 1952) is in use.
	GZIPFormat
)

func (Format) GoString

func (f Format) GoString() string

GoString returns the Go string representation of this Format constant.

func (Format) IsValid

func (f Format) IsValid() bool

IsValid returns true if f is a valid Format constant.

func (Format) MarshalJSON

func (f Format) MarshalJSON() ([]byte, error)

MarshalJSON returns the JSON representation of this Format constant.

func (*Format) Parse

func (f *Format) Parse(str string) error

Parse parses a string representation of a Format constant.

func (Format) String

func (f Format) String() string

String returns the string representation of this Format constant.

type Header struct {
	FileName      string
	Comment       string
	LastModified  time.Time
	DataType      DataType
	OSType        OSType
	ExtraData     ExtraData
	WindowBits    WindowBits
	CompressLevel CompressLevel
}

Header is a collection of fields which may be present in the headers of a gzip or zlib stream.

type MemoryLevel

type MemoryLevel byte

MemoryLevel indicates the amount of RAM for the Reader or Writer to use.

const (
	// DefaultMemory requests that the default value for MemoryLevel be
	// selected.  This is currently equivalent to 9 (FastestMemory).
	DefaultMemory MemoryLevel = 0

	// SmallestMemory is the smallest possible MemoryLevel.  As MemoryLevel
	// increases from 1 (SmallestMemory) to 9 (FastestMemory), the amount
	// of memory used doubles with each increase.
	SmallestMemory MemoryLevel = 1

	// FastestMemory is the largest possible MemoryLevel.  As MemoryLevel
	// increases from 1 (SmallestMemory) to 9 (FastestMemory), the amount
	// of memory used doubles with each increase.
	FastestMemory MemoryLevel = 9
)

func (MemoryLevel) GoString

func (mlevel MemoryLevel) GoString() string

GoString returns the Go string representation of this MemoryLevel constant.

func (MemoryLevel) IsValid

func (mlevel MemoryLevel) IsValid() bool

IsValid returns true if mlevel is a valid MemoryLevel constant.

func (MemoryLevel) MarshalJSON

func (mlevel MemoryLevel) MarshalJSON() ([]byte, error)

MarshalJSON returns the JSON representation of this MemoryLevel constant.

func (*MemoryLevel) Parse

func (mlevel *MemoryLevel) Parse(str string) error

Parse parses a string representation of a MemoryLevel constant.

func (MemoryLevel) String

func (mlevel MemoryLevel) String() string

String returns the string representation of this MemoryLevel constant.

type Method

type Method byte

Method indicates the compression method in use.

Currently, only DEFLATE compression is supported.

const (
	// DeflateMethod indicates that DEFLATE compression should be used.
	DeflateMethod Method = iota

	// DefaultMethod requests that the default Method be used, which is
	// currently DeflateMethod.
	DefaultMethod = DeflateMethod
)

func (Method) GoString

func (m Method) GoString() string

GoString returns the Go string representation of this Method constant.

func (Method) IsValid

func (m Method) IsValid() bool

IsValid returns true if m is a valid Method constant.

func (Method) MarshalJSON

func (m Method) MarshalJSON() ([]byte, error)

MarshalJSON returns the JSON representation of this Method constant.

func (Method) String

func (m Method) String() string

String returns the string representation of this Method constant.

type NoOpTracer

type NoOpTracer struct{}

NoOpTracer is an implementation of Tracer that does nothing.

func (NoOpTracer) OnEvent

func (NoOpTracer) OnEvent(event Event)

OnEvent fulfills Tracer.

type OSType

type OSType byte

OSType indicates the OS or filesystem type on which a gzip-compressed file originated.

const (
	// OSTypeUnknown indicates that the originating OS and/or filesystem is
	// not known.
	OSTypeUnknown OSType = iota

	// OSTypeFAT indicates that the file originated on an MS-DOS or Microsoft
	// Windows host with a FAT-based filesystem such as FAT16 or FAT32.
	OSTypeFAT

	// OSTypeAmiga indicates that the file originated on an Amiga host.
	OSTypeAmiga

	// OSTypeVMS indicates that the file originated on a VMS host.
	OSTypeVMS

	// OSTypeUnix indicates that the file originated on a Unix host, or on a
	// host with a Unix-like filesystem.
	OSTypeUnix

	// OSTypeVMCMS indicates that the file originated on a VM/CMS host.
	OSTypeVMCMS

	// OSTypeAtariTOS indicates that the file originated on an Atari TOS
	// host.
	OSTypeAtariTOS

	// OSTypeHPFS indicates that the file originated on an OS/2 host with an
	// HPFS filesystem.
	OSTypeHPFS

	// OSTypeMacintosh indicates that the file originated on an Apple
	// Macintosh host (Classic or Mac OS X) with an HFS or HFS+
	// filesystem.
	OSTypeMacintosh

	// OSTypeZSystem indicates that the file originated on an IBM Z/System host.
	OSTypeZSystem

	// OSTypeCPM indicates that the file originated on a CP/M host.
	OSTypeCPM

	// OSTypeTOPS20 indicates that the file originated on a TOPS-20 host.
	OSTypeTOPS20

	// OSTypeNTFS indicates that the file originated on a Microsoft Windows NT
	// host with an NTFS filesystem.
	OSTypeNTFS

	// OSTypeQDOS indicates that the file originated on a QDOS host.
	OSTypeQDOS

	// OSTypeAcornRISCOS indicates that the file originated on an Acorn RISCOS
	// host.
	OSTypeAcornRISCOS
)

func (OSType) GoString

func (o OSType) GoString() string

GoString returns the Go string representation of this OSType constant.

func (OSType) IsValid

func (o OSType) IsValid() bool

IsValid returns true if o is a valid OSType constant.

func (OSType) MarshalJSON

func (o OSType) MarshalJSON() ([]byte, error)

MarshalJSON returns the JSON representation of this OSType constant.

func (OSType) String

func (o OSType) String() string

String returns the string representation of this OSType constant.

type Option

type Option func(*options)

Option represents a configuration option for Reader or Writer.

func WithCompressLevel

func WithCompressLevel(clevel CompressLevel) Option

WithCompressLevel specifies the CompressLevel to use (Writer). Ignored by Reader.

func WithDictionary

func WithDictionary(dict []byte) Option

WithDictionary specifies the pre-shared LZ77 dictionary to use (Writer) or to assume (Reader). May specify nil to abandon a previously used pre-shared dictionary.

func WithFormat

func WithFormat(format Format) Option

WithFormat specifies the Format to write (Writer) or expected to be read (Reader).

func WithMemoryLevel

func WithMemoryLevel(mlevel MemoryLevel) Option

WithMemoryLevel specifies the MemoryLevel to use (Reader, Writer).

func WithMethod

func WithMethod(method Method) Option

WithMethod specifies the Method to use (Writer). Ignored by Reader.

func WithStrategy

func WithStrategy(strategy Strategy) Option

WithStrategy specifies the Strategy to use (Writer). Ignored by Reader.

func WithTracers

func WithTracers(tracers ...Tracer) Option

WithTracers specifies the list of Tracer instances which will receive Events as compression (Writer) or decompression (Reader) proceeds. Completely replaces any previous list.

func WithWindowBits

func WithWindowBits(wbits WindowBits) Option

WithWindowBits specifies the WindowBits to use (Writer) or the maximum WindowBits to expect (Reader).

type Reader

type Reader struct {
	// contains filtered or unexported fields
}

Reader wraps an io.Reader and decompresses the data which flows through it.

func NewReader

func NewReader(r io.Reader, opts ...Option) *Reader

NewReader constructs and returns a new Reader with the given io.Reader and options.

func (*Reader) Close

func (fr *Reader) Close() error

Close terminates decompression and closes this Reader.

The underlying io.Reader is *not* closed, even if it supports io.Closer.

The only method which is guaranteed to be safe to call on a Reader after Close is Reset, which will return the Reader to a non-closed state.

func (*Reader) Dict

func (fr *Reader) Dict() []byte

Dict returns the pre-shared LZ77 dictionary which this Reader uses, or nil if no such dictionary is in use.

func (*Reader) Format

func (fr *Reader) Format() Format

Format returns the Format which this Reader uses.

func (*Reader) MemoryLevel

func (fr *Reader) MemoryLevel() MemoryLevel

MemoryLevel returns the MemoryLevel which this Reader uses.

func (*Reader) Read

func (fr *Reader) Read(p []byte) (int, error)

Read reads from the compressed stream into the provided slice of bytes. Conforms to the io.Reader interface.

func (*Reader) Reset

func (fr *Reader) Reset(r io.Reader, opts ...Option)

Reset re-initializes this Reader with the given io.Reader and options. Any options given here are merged with all previous options.

func (*Reader) Tracers

func (fr *Reader) Tracers() []Tracer

Tracers returns the Tracers which this Reader uses.

func (*Reader) UnderlyingReader

func (fr *Reader) UnderlyingReader() io.Reader

UnderlyingReader returns the io.Reader which this Reader uses.

func (*Reader) WindowBits

func (fr *Reader) WindowBits() WindowBits

WindowBits returns the WindowBits which this Reader uses.

type SizeList

type SizeList []byte

SizeList represents a list of symbol sizes in a Canonical Huffman Code.

func (SizeList) MarshalJSON

func (sizelist SizeList) MarshalJSON() ([]byte, error)

MarshalJSON returns the JSON representation of this SizeList, as a JSON Array of JSON Numbers.

type Strategy

type Strategy byte

Strategy indicates which compression strategy to use. Each strategy represents a different compression algorithm, but all available algorithms are compatible with the standard decompression algorithm.

const (
	// DefaultStrategy indicates that the standard strategy be used.
	DefaultStrategy Strategy = iota

	// HuffmanOnlyStrategy indicates that LZ77 should not be used, only
	// Huffman coding.
	HuffmanOnlyStrategy

	// HuffmanRLEStrategy indicates that LZ77 should only be used for
	// run-length encoding (RLE), not for more complex history matching.
	HuffmanRLEStrategy

	// FixedStrategy indicates that all Huffman-encoded blocks should use
	// the static (pre-defined) Huffman encoding defined by the DEFLATE
	// standard, not the dynamic encodings that are optimal for each block.
	FixedStrategy
)

func (Strategy) GoString

func (s Strategy) GoString() string

GoString returns the Go string representation of this Strategy constant.

func (Strategy) IsValid

func (s Strategy) IsValid() bool

IsValid returns true if s is a valid Strategy constant.

func (Strategy) MarshalJSON

func (s Strategy) MarshalJSON() ([]byte, error)

MarshalJSON returns the JSON representation of this Strategy constant.

func (*Strategy) Parse

func (s *Strategy) Parse(str string) error

Parse parses a string representation of a Strategy constant.

func (Strategy) String

func (s Strategy) String() string

String returns the string representation of this Strategy constant.

type Tracer

type Tracer interface {
	OnEvent(Event)
}

Tracer is an interface which callers can implement in order to receive Events. Events provide feedback on the progress of the compression or decompression operation.

func CaptureHeader

func CaptureHeader(ptr *Header) Tracer

CaptureHeader returns a Tracer implementation which will fill the pointed-to Header object when StreamHeaderEvent is encountered.

func Log

func Log(logger zerolog.Logger) Tracer

Log returns a Tracer implementation which will log each Event at Trace priority.

type TracerFunc

type TracerFunc func(Event)

TracerFunc is an implementation of Tracer that calls a function.

func (TracerFunc) OnEvent

func (tr TracerFunc) OnEvent(event Event)

OnEvent fulfills Tracer.

type TreesEvent

type TreesEvent struct {
	CodeCount          uint16
	LiteralLengthCount uint16
	DistanceCount      uint16

	CodeSizes          SizeList
	LiteralLengthSizes SizeList
	DistanceSizes      SizeList
}

TreesEvent is a sub-struct that is only present for BlockTreesEvent.

type WindowBits

type WindowBits byte

WindowBits indicates the amount of RAM for the LZ77 sliding window to use.

const (
	// DefaultWindowBits requests that the default value for WindowBits be
	// selected.  This is equivalent to 15 (MaxWindowBits).
	DefaultWindowBits WindowBits = 0

	// MinWindowBits is the smallest possible WindowBits.  As WindowBits
	// increases from 8 (MinWindowBits) to 15 (MaxWindowBits), the amount
	// of memory used for the sliding window doubles with each increase.  A
	// larger sliding window typically yields greater compression.
	MinWindowBits WindowBits = 8

	// MaxWindowBits is the largest possible WindowBits.  As WindowBits
	// increases from 8 (MinWindowBits) to 15 (MaxWindowBits), the amount
	// of memory used for the sliding window doubles with each increase.  A
	// larger sliding window typically yields greater compression.
	MaxWindowBits WindowBits = 15
)

func (WindowBits) GoString

func (wbits WindowBits) GoString() string

GoString returns the Go string representation of this WindowBits constant.

func (WindowBits) IsValid

func (wbits WindowBits) IsValid() bool

IsValid returns true if wbits is a valid WindowBits constant.

func (WindowBits) MarshalJSON

func (wbits WindowBits) MarshalJSON() ([]byte, error)

MarshalJSON returns the JSON representation of this WindowBits constant.

func (*WindowBits) Parse

func (wbits *WindowBits) Parse(str string) error

Parse parses a string representation of a WindowBits constant.

func (WindowBits) String

func (wbits WindowBits) String() string

String returns the string representation of this WindowBits constant.

type Writer

type Writer struct {
	// contains filtered or unexported fields
}

Writer wraps an io.Writer and compresses the data which flows through it.

func NewWriter

func NewWriter(w io.Writer, opts ...Option) *Writer

NewWriter constructs and returns a new Writer with the given io.Writer and options.

func (*Writer) Close

func (fw *Writer) Close() error

Close finishes the compressed stream and closes this Writer.

The underlying io.Writer is *not* closed, even if it supports io.Closer.

The only method which is guaranteed to be safe to call on a Writer after Close is Reset, which will return the Writer to a non-closed state.

func (*Writer) CompressLevel

func (fw *Writer) CompressLevel() CompressLevel

CompressLevel returns the CompressLevel which this Writer uses.

func (*Writer) Dict

func (fw *Writer) Dict() []byte

Dict returns the pre-shared LZ77 dictionary which this Writer uses, or nil if no such dictionary is in use.

func (*Writer) Flush

func (fw *Writer) Flush(flushType FlushType) error

Flush flushes the buffered compressed data to the underlying io.Writer.

func (*Writer) Format

func (fw *Writer) Format() Format

Format returns the Format which this Writer uses.

func (*Writer) MemoryLevel

func (fw *Writer) MemoryLevel() MemoryLevel

MemoryLevel returns the MemoryLevel which this Writer uses.

func (*Writer) Method

func (fw *Writer) Method() Method

Method returns the Method which this Writer uses.

func (*Writer) Reset

func (fw *Writer) Reset(w io.Writer, opts ...Option)

Reset re-initializes this Writer with the given io.Writer and options. Any options given here are merged with all previous options.

func (*Writer) SetHeader

func (fw *Writer) SetHeader(header Header) error

SetHeader sets a custom gzip header when writing in GZIPFormat.

func (*Writer) Strategy

func (fw *Writer) Strategy() Strategy

Strategy returns the Strategy which this Writer uses.

func (*Writer) Tracers

func (fw *Writer) Tracers() []Tracer

Tracers returns the Tracers which this Writer uses.

func (*Writer) UnderlyingWriter

func (fw *Writer) UnderlyingWriter() io.Writer

UnderlyingWriter returns the io.Writer which this Writer uses.

func (*Writer) WindowBits

func (fw *Writer) WindowBits() WindowBits

WindowBits returns the WindowBits which this Writer uses.

func (*Writer) Write

func (fw *Writer) Write(buf []byte) (int, error)

Write writes a slice of bytes to the compressed stream. Conforms to the io.Writer interface.

Directories

Path Synopsis
cmd
internal

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL