ResetContentSize will reset and set a content size for the next stream. If the bytes written does not match the size given an error will be returned when calling Close(). This is removed when Reset is called. Sizes <= 0 results in no content size set.
(w io.Writer, size int64)
| 189 | // This is removed when Reset is called. |
| 190 | // Sizes <= 0 results in no content size set. |
| 191 | func (e *Encoder) ResetContentSize(w io.Writer, size int64) { |
| 192 | e.Reset(w) |
| 193 | if size >= 0 { |
| 194 | e.state.frameContentSize = size |
| 195 | } |
| 196 | } |
| 197 | |
| 198 | // Write data to the encoder. |
| 199 | // Input data will be buffered and as the buffer fills up |