Writer is an io.Writer that can write Snappy-compressed bytes. Writer handles the Snappy stream format, not the Snappy block format.
| 146 | // |
| 147 | // Writer handles the Snappy stream format, not the Snappy block format. |
| 148 | type 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. |
nothing calls this directly
no outgoing calls
no test coverage detected