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

Method ReadUint16

go/fory/buffer.go:349–358  ·  view source on GitHub ↗

ReadUint16 reads a uint16 and sets error on bounds violation

(err *Error)

Source from the content-addressed store, hash-verified

347
348// ReadUint16 reads a uint16 and sets error on bounds violation
349func (b *ByteBuffer) ReadUint16(err *Error) uint16 {
350 if b.readerIndex+2 > len(b.data) {
351 if !b.fill(2, err) {
352 return 0
353 }
354 }
355 v := binary.LittleEndian.Uint16(b.data[b.readerIndex:])
356 b.readerIndex += 2
357 return v
358}
359
360// ReadUint32 reads a uint32 and sets error on bounds violation
361func (b *ByteBuffer) ReadUint32(err *Error) uint32 {

Callers 14

ReadDataMethod · 0.80
ReadDataMethod · 0.80
readDirectIntegerScalarFunction · 0.80
ReadDataMethod · 0.80
ReadDataMethod · 0.80
ReadDataMethod · 0.80
readRemainingFieldMethod · 0.80
readOptionFastFunction · 0.80
readFieldsInOrderMethod · 0.80
skipValueFunction · 0.80
readFastMethod · 0.80

Calls 1

fillMethod · 0.95

Tested by

no test coverage detected