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

Method ReadLength

go/fory/buffer.go:248–258  ·  view source on GitHub ↗
(err *Error)

Source from the content-addressed store, hash-verified

246}
247
248func (b *ByteBuffer) ReadLength(err *Error) int {
249 length := b.ReadVarUint32(err)
250 const maxInt32 = uint32(1<<31 - 1)
251 if intSize == 32 && length > maxInt32 {
252 if err != nil {
253 *err = DeserializationErrorf("length %d exceeds supported int range", length)
254 }
255 return 0
256 }
257 return int(length)
258}
259
260func (b *ByteBuffer) WriteUint64(value uint64) {
261 b.grow(8)

Callers 15

ReadByteSliceFunction · 0.80
ReadBoolSliceFunction · 0.80
ReadInt8SliceFunction · 0.80
ReadInt16SliceFunction · 0.80
ReadInt32SliceFunction · 0.80
ReadInt64SliceFunction · 0.80
ReadUint16SliceFunction · 0.80
ReadUint32SliceFunction · 0.80
ReadUint64SliceFunction · 0.80
ReadFloat32SliceFunction · 0.80
ReadFloat64SliceFunction · 0.80
ReadIntSliceFunction · 0.80

Calls 3

ReadVarUint32Method · 0.95
DeserializationErrorfFunction · 0.85
uint32Function · 0.50

Tested by

no test coverage detected