WriteArrayHeader writes an array header of the given size to the writer
(sz uint32)
| 335 | // WriteArrayHeader writes an array header of the |
| 336 | // given size to the writer |
| 337 | func (mw *Writer) WriteArrayHeader(sz uint32) error { |
| 338 | switch { |
| 339 | case sz <= 15: |
| 340 | return mw.push(wfixarray(uint8(sz))) |
| 341 | case sz <= math.MaxUint16: |
| 342 | return mw.prefix16(marray16, uint16(sz)) |
| 343 | default: |
| 344 | return mw.prefix32(marray32, sz) |
| 345 | } |
| 346 | } |
| 347 | |
| 348 | // WriteNil writes a nil byte to the buffer |
| 349 | func (mw *Writer) WriteNil() error { |