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

Method WriteLength

go/fory/buffer.go:240–246  ·  view source on GitHub ↗
(value int)

Source from the content-addressed store, hash-verified

238}
239
240func (b *ByteBuffer) WriteLength(value int) {
241 b.grow(4)
242 if value >= MaxInt32 {
243 panic(fmt.Errorf("too long: %d", value))
244 }
245 b.WriteVarUint32(uint32(value))
246}
247
248func (b *ByteBuffer) ReadLength(err *Error) int {
249 length := b.ReadVarUint32(err)

Calls 3

growMethod · 0.95
WriteVarUint32Method · 0.95
uint32Function · 0.50