MCPcopy
hub / github.com/klauspost/compress / NewReaderOpts

Function NewReaderOpts

flate/inflate.go:913–934  ·  view source on GitHub ↗

NewReaderOpts returns new reader with provided options

(r io.Reader, opts ...ReaderOpt)

Source from the content-addressed store, hash-verified

911
912// NewReaderOpts returns new reader with provided options
913func NewReaderOpts(r io.Reader, opts ...ReaderOpt) io.ReadCloser {
914 fixedHuffmanDecoderInit()
915
916 var f decompressor
917 f.r = makeReader(r)
918 f.bits = new([maxNumLit + maxNumDist]int)
919 f.codebits = new([numCodes]int)
920 f.step = nextBlock
921 f.dict.init(maxMatchOffset, nil)
922
923 for _, opt := range opts {
924 opt(&f)
925 }
926
927 if f.hasCP {
928 if err := f.applyCP(f.cp); err != nil {
929 f.err = err
930 }
931 }
932
933 return &f
934}
935
936// NewReader returns a new ReadCloser that can be used
937// to read the uncompressed version of r.

Callers 5

TestReaderPartialBlockFunction · 0.85
NewReaderFunction · 0.85
NewReaderDictFunction · 0.85

Calls 4

applyCPMethod · 0.95
fixedHuffmanDecoderInitFunction · 0.85
makeReaderFunction · 0.85
initMethod · 0.45

Tested by 3

TestReaderPartialBlockFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…