MCPcopy Create free account
hub / github.com/containers/image / DetectCompression

Function DetectCompression

pkg/compression/compression.go:151–154  ·  view source on GitHub ↗

DetectCompression returns a DecompressorFunc if the input is recognized as a compressed format, nil otherwise. Because it consumes the start of input, other consumers must use the returned io.Reader instead to also read from the beginning.

(input io.Reader)

Source from the content-addressed store, hash-verified

149// DetectCompression returns a DecompressorFunc if the input is recognized as a compressed format, nil otherwise.
150// Because it consumes the start of input, other consumers must use the returned io.Reader instead to also read from the beginning.
151func DetectCompression(input io.Reader) (DecompressorFunc, io.Reader, error) {
152 _, d, r, e := DetectCompressionFormat(input)
153 return d, r, e
154}
155
156// AutoDecompress takes a stream and returns an uncompressed version of the
157// same stream.

Callers 2

AutoDecompressFunction · 0.85
TestDetectCompressionFunction · 0.85

Calls 1

DetectCompressionFormatFunction · 0.85

Tested by 1

TestDetectCompressionFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…