push one byte onto the buffer NOTE: this is a hot code path
(b byte)
| 222 | // |
| 223 | // NOTE: this is a hot code path |
| 224 | func (mw *Writer) push(b byte) error { |
| 225 | if mw.wloc == len(mw.buf) { |
| 226 | if err := mw.flush(); err != nil { |
| 227 | return err |
| 228 | } |
| 229 | } |
| 230 | mw.buf[mw.wloc] = b |
| 231 | mw.wloc++ |
| 232 | return nil |
| 233 | } |
| 234 | |
| 235 | func (mw *Writer) prefix8(b byte, u uint8) error { |
| 236 | const need = 2 |
no test coverage detected