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

Struct Writer

internal/snapref/encode.go:148–164  ·  view source on GitHub ↗

Writer is an io.Writer that can write Snappy-compressed bytes. Writer handles the Snappy stream format, not the Snappy block format.

Source from the content-addressed store, hash-verified

146//
147// Writer handles the Snappy stream format, not the Snappy block format.
148type Writer struct {
149 w io.Writer
150 err error
151
152 // ibuf is a buffer for the incoming (uncompressed) bytes.
153 //
154 // Its use is optional. For backwards compatibility, Writers created by the
155 // NewWriter function have ibuf == nil, do not buffer incoming bytes, and
156 // therefore do not need to be Flush'ed or Close'd.
157 ibuf []byte
158
159 // obuf is a buffer for the outgoing (compressed) bytes.
160 obuf []byte
161
162 // wroteStreamHeader is whether we have written the stream header.
163 wroteStreamHeader bool
164}
165
166// Reset discards the writer's state and switches the Snappy writer to write to
167// w. This permits reusing a Writer rather than allocating a new one.

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected