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

Method ReadVarint64

go/fory/buffer.go:1052–1059  ·  view source on GitHub ↗

ReadVarint64 reads the varint encoded with zig-zag (compatible with Java's readVarint64).

(err *Error)

Source from the content-addressed store, hash-verified

1050
1051// ReadVarint64 reads the varint encoded with zig-zag (compatible with Java's readVarint64).
1052func (b *ByteBuffer) ReadVarint64(err *Error) int64 {
1053 u := b.ReadVarUint64(err)
1054 v := int64(u >> 1)
1055 if u&1 != 0 {
1056 v = ^v
1057 }
1058 return v
1059}
1060
1061// WriteTaggedInt64 writes int64 using tagged encoding.
1062// If value is in [-1073741824, 1073741823], encode as 4 bytes: ((value as i32) << 1).

Callers 15

testBufferVarFunction · 0.95
ReadDataMethod · 0.45
readNumericValueByTypeIDFunction · 0.45
readDirectIntegerScalarFunction · 0.45
ReadDataMethod · 0.45
ReadDataMethod · 0.45
ReadDataMethod · 0.45
readRemainingFieldMethod · 0.45
readOptionFastFunction · 0.45

Calls 2

ReadVarUint64Method · 0.95
int64Function · 0.50