MCPcopy Create free account
hub / github.com/google/gapid / ReadInt

Function ReadInt

core/data/binary/reader.go:85–99  ·  view source on GitHub ↗

ReadInt reads a signed integer of either 8, 16, 32 or 64 bits from r, returning the result as a int64.

(r Reader, bits int32)

Source from the content-addressed store, hash-verified

83// ReadInt reads a signed integer of either 8, 16, 32 or 64 bits from r,
84// returning the result as a int64.
85func ReadInt(r Reader, bits int32) int64 {
86 switch bits {
87 case 8:
88 return int64(r.Int8())
89 case 16:
90 return int64(r.Int16())
91 case 32:
92 return int64(r.Int32())
93 case 64:
94 return r.Int64()
95 default:
96 r.SetError(fmt.Errorf("Unsupported integer bit count %v", bits))
97 return 0
98 }
99}
100
101// ConsumeBytes reads and throws away a number of bytes from r, returning the
102// number of bytes it consumed.

Callers

nothing calls this directly

Calls 5

Int8Method · 0.65
Int16Method · 0.65
Int32Method · 0.65
Int64Method · 0.65
SetErrorMethod · 0.65

Tested by

no test coverage detected