MCPcopy Create free account
hub / github.com/apache/fory / UnsafePutVarInt64

Method UnsafePutVarInt64

go/fory/buffer.go:782–785  ·  view source on GitHub ↗

UnsafePutVarInt64 writes a zigzag-encoded varint64 at the given offset without advancing writerIndex. Caller must have called Reserve() to ensure capacity. Returns the number of bytes written (1-9).

(offset int, value int64)

Source from the content-addressed store, hash-verified

780// Caller must have called Reserve() to ensure capacity.
781// Returns the number of bytes written (1-9).
782func (b *ByteBuffer) UnsafePutVarInt64(offset int, value int64) int {
783 u := uint64((value << 1) ^ (value >> 63))
784 return b.UnsafePutVarUint64(offset, u)
785}
786
787// UnsafePutVarUint64 writes an unsigned VarUint64 at the given offset without advancing writerIndex.
788// Caller must have called Reserve(16) to ensure capacity (for bulk writes).

Callers 1

WriteDataMethod · 0.80

Calls 2

UnsafePutVarUint64Method · 0.95
uint64Function · 0.50

Tested by

no test coverage detected