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

Method ReadInt32

msgp/read.go:749–758  ·  view source on GitHub ↗

ReadInt32 reads an int32 from the reader

()

Source from the content-addressed store, hash-verified

747
748// ReadInt32 reads an int32 from the reader
749func (m *Reader) ReadInt32() (i int32, err error) {
750 var in int64
751 in, err = m.ReadInt64()
752 if in > math.MaxInt32 || in < math.MinInt32 {
753 err = IntOverflow{Value: in, FailedBitsize: 32}
754 return
755 }
756 i = int32(in)
757 return
758}
759
760// ReadInt16 reads an int16 from the reader
761func (m *Reader) ReadInt16() (i int16, err error) {

Callers 5

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

Calls 1

ReadInt64Method · 0.95

Tested by 2

TestReadIntOverflowsFunction · 0.76
FuzzReaderFunction · 0.76