MCPcopy Create free account
hub / github.com/ZeppelinMC/Zeppelin / PutVarInt

Function PutVarInt

protocol/net/io/encoding/encoding.go:43–53  ·  view source on GitHub ↗
(data []byte, value int32)

Source from the content-addressed store, hash-verified

41}
42
43func PutVarInt(data []byte, value int32) (n int) {
44 ux := uint32(value)
45 var i int
46 for ; ux >= 0x80; i++ {
47 data[i] = byte(ux&0x7F) | 0x80
48 ux >>= 7
49 }
50 data[i] = byte(ux)
51
52 return i
53}
54
55func WriteVarInt(w io.Writer, value int32) error {
56 ux := uint32(value)

Callers 1

wpkMethod · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected