flatetest

package
v0.0.0-...-0bbbf19 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewWriter

func NewWriter(t testing.TB, w io.Writer, level int) *flate.Writer

NewWriter returns a new [Writer] compressing data at the given level. Following zlib, levels range from 1 ([BestSpeed]) to 9 ([BestCompression]); higher levels typically run slower but compress more. Level 0 ([NoCompression]) does not attempt any compression; it only adds the necessary DEFLATE framing. Level -1 ([DefaultCompression]) uses the default compression level. Level -2 ([HuffmanOnly]) will use Huffman compression only, giving a very fast compression for all types of input, but sacrificing considerable compression efficiency.

If level is in the range [-2, 9] then the error returned will be nil. Otherwise the error returned will be non-nil.

func NewWriterDict

func NewWriterDict(t testing.TB, w io.Writer, level int, dict []byte) *flate.Writer

NewWriterDict is like NewWriter but initializes the new [Writer] with a preset dictionary. The returned [Writer] behaves as if the dictionary had been written to it without producing any compressed output. The compressed data written to w can only be decompressed by a [Reader] initialized with the same dictionary.

Types

This section is empty.

Jump to

Keyboard shortcuts

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