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

Function WriteUint

core/data/binary/writer.go:63–76  ·  view source on GitHub ↗

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

(w Writer, bits int32, v uint64)

Source from the content-addressed store, hash-verified

61
62// WriteUint writes the unsigned integer v of either 8, 16, 32 or 64 bits to w.
63func WriteUint(w Writer, bits int32, v uint64) {
64 switch bits {
65 case 8:
66 w.Uint8(uint8(v))
67 case 16:
68 w.Uint16(uint16(v))
69 case 32:
70 w.Uint32(uint32(v))
71 case 64:
72 w.Uint64(uint64(v))
73 default:
74 w.SetError(fmt.Errorf("Unsupported integer bit count %v", bits))
75 }
76}
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) {

Callers

nothing calls this directly

Calls 5

Uint8Method · 0.65
Uint16Method · 0.65
Uint32Method · 0.65
Uint64Method · 0.65
SetErrorMethod · 0.65

Tested by

no test coverage detected