UnsafePutVarInt32 writes a zigzag-encoded varint32 at the given offset without advancing writerIndex. Caller must have called Reserve() to ensure capacity. Returns the number of bytes written (1-5).
(offset int, value int32)
| 716 | // Caller must have called Reserve() to ensure capacity. |
| 717 | // Returns the number of bytes written (1-5). |
| 718 | func (b *ByteBuffer) UnsafePutVarInt32(offset int, value int32) int { |
| 719 | u := uint32((value << 1) ^ (value >> 31)) |
| 720 | return b.UnsafePutVarUint32(offset, u) |
| 721 | } |
| 722 | |
| 723 | // UnsafePutVarUint32 writes an unsigned VarUint32 at the given offset without advancing writerIndex. |
| 724 | // Caller must have called Reserve(8) to ensure capacity (8 for bulk uint64 write). |
no test coverage detected