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

Method ReadInt16

go/fory/buffer.go:337–346  ·  view source on GitHub ↗

ReadInt16 reads an int16 and sets error on bounds violation

(err *Error)

Source from the content-addressed store, hash-verified

335
336// ReadInt16 reads an int16 and sets error on bounds violation
337func (b *ByteBuffer) ReadInt16(err *Error) int16 {
338 if b.readerIndex+2 > len(b.data) {
339 if !b.fill(2, err) {
340 return 0
341 }
342 }
343 v := int16(binary.LittleEndian.Uint16(b.data[b.readerIndex:]))
344 b.readerIndex += 2
345 return v
346}
347
348// ReadUint16 reads a uint16 and sets error on bounds violation
349func (b *ByteBuffer) ReadUint16(err *Error) uint16 {

Callers 15

testBufferFunction · 0.95
ReadInt16SliceFunction · 0.45
ReadUint16SliceFunction · 0.45
readDirectIntegerScalarFunction · 0.45
ReadDataMethod · 0.45
readRemainingFieldMethod · 0.45
readOptionFastFunction · 0.45
readFieldsInOrderMethod · 0.45
skipValueFunction · 0.45
RawInt16Method · 0.45
readFastMethod · 0.45

Calls 2

fillMethod · 0.95
int16Function · 0.50

Tested by

no test coverage detected