go:nosplit
(ty byte, tag byte)
| 153 | |
| 154 | //go:nosplit |
| 155 | func (b *Buffer) WriteHead(ty byte, tag byte) error { |
| 156 | if tag < 15 { |
| 157 | data := (tag << 4) | ty |
| 158 | return b.buf.WriteByte(data) |
| 159 | } else { |
| 160 | data := (15 << 4) | ty |
| 161 | if err := b.buf.WriteByte(data); err != nil { |
| 162 | return err |
| 163 | } |
| 164 | return b.buf.WriteByte(tag) |
| 165 | } |
| 166 | } |
| 167 | |
| 168 | // Reset clean the buffer. |
| 169 | func (b *Buffer) Reset() { |
no outgoing calls