MCPcopy Create free account
hub / github.com/LagrangeDev/LagrangeGo / writeint

Function writeint

utils/binary/builder.go:162–167  ·  view source on GitHub ↗
(b *Builder, v T)

Source from the content-addressed store, hash-verified

160}
161
162func writeint[T ~uint16 | ~uint32 | ~uint64](b *Builder, v T) *Builder {
163 buf := make([]byte, 8)
164 binary.BigEndian.PutUint64(buf, uint64(v))
165 _, _ = b.Write(buf[8-unsafe.Sizeof(v):])
166 return b
167}
168
169func (b *Builder) WriteU16(v uint16) *Builder {
170 return writeint(b, v)

Callers 3

WriteU16Method · 0.85
WriteU32Method · 0.85
WriteU64Method · 0.85

Calls 1

WriteMethod · 0.45

Tested by

no test coverage detected