Minimal msgpack writers for the structured data section.
(buf []byte, length int)
| 756 | // Minimal msgpack writers for the structured data section. |
| 757 | |
| 758 | func msgpackWriteArrayHeader(buf []byte, length int) []byte { |
| 759 | if length <= 0x0f { |
| 760 | return append(buf, byte(0x90|length)) |
| 761 | } |
| 762 | if length <= 0xffff { |
| 763 | return append(buf, 0xdc, byte(length>>8), byte(length)) |
| 764 | } |
| 765 | return append(buf, 0xdd, byte(length>>24), byte(length>>16), byte(length>>8), byte(length)) |
| 766 | } |
| 767 | |
| 768 | func msgpackWriteUint(buf []byte, value uint32) []byte { |
| 769 | if value <= 0x7f { |
no test coverage detected