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

Function WriteInt

core/data/binary/writer.go:79–92  ·  view source on GitHub ↗

WriteInt writes the signed integer v of either 8, 16, 32 or 64 bits to w.

(w Writer, bits int32, v int64)

Source from the content-addressed store, hash-verified

77
78// WriteInt writes the signed integer v of either 8, 16, 32 or 64 bits to w.
79func WriteInt(w Writer, bits int32, v int64) {
80 switch bits {
81 case 8:
82 w.Int8(int8(v))
83 case 16:
84 w.Int16(int16(v))
85 case 32:
86 w.Int32(int32(v))
87 case 64:
88 w.Int64(int64(v))
89 default:
90 w.SetError(fmt.Errorf("Unsupported integer bit count %v", bits))
91 }
92}
93
94// WriteBytes writes the given v for count times to writer w.
95func WriteBytes(w Writer, v uint8, count int32) {

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