Write data to the encoder. Input data will be buffered and as the buffer fills up content will be compressed and written to the output. When done writing, use Close to flush the remaining output and write CRC if requested.
(p []byte)
| 201 | // When done writing, use Close to flush the remaining output |
| 202 | // and write CRC if requested. |
| 203 | func (e *Encoder) Write(p []byte) (n int, err error) { |
| 204 | s := &e.state |
| 205 | if s.eofWritten { |
| 206 | return 0, ErrEncoderClosed |
| 207 | } |
| 208 | if e.o.concurrentBlocks { |
| 209 | return e.writeJobs(p) |
| 210 | } |
| 211 | return e.writeBlocks(p) |
| 212 | } |
| 213 | |
| 214 | func (e *Encoder) writeJobs(p []byte) (n int, err error) { |
| 215 | s := &e.state |
nothing calls this directly
no test coverage detected