MCPcopy Create free account
hub / github.com/tinylib/msgp / ReadInt16

Method ReadInt16

msgp/read.go:761–770  ·  view source on GitHub ↗

ReadInt16 reads an int16 from the reader

()

Source from the content-addressed store, hash-verified

759
760// ReadInt16 reads an int16 from the reader
761func (m *Reader) ReadInt16() (i int16, err error) {
762 var in int64
763 in, err = m.ReadInt64()
764 if in > math.MaxInt16 || in < math.MinInt16 {
765 err = IntOverflow{Value: in, FailedBitsize: 16}
766 return
767 }
768 i = int16(in)
769 return
770}
771
772// ReadInt8 reads an int8 from the reader
773func (m *Reader) ReadInt8() (i int8, err error) {

Callers 4

TestReadIntOverflowsFunction · 0.95
FuzzReaderFunction · 0.95
DecodeMsgMethod · 0.80
DecodeMsgMethod · 0.80

Calls 1

ReadInt64Method · 0.95

Tested by 2

TestReadIntOverflowsFunction · 0.76
FuzzReaderFunction · 0.76