MCPcopy
hub / github.com/tinylib/msgp / WriteUint64

Method WriteUint64

msgp/write.go:419–432  ·  view source on GitHub ↗

WriteUint64 writes a uint64 to the writer

(u uint64)

Source from the content-addressed store, hash-verified

417
418// WriteUint64 writes a uint64 to the writer
419func (mw *Writer) WriteUint64(u uint64) error {
420 switch {
421 case u <= (1<<7)-1:
422 return mw.push(wfixint(uint8(u)))
423 case u <= math.MaxUint8:
424 return mw.prefix8(muint8, uint8(u))
425 case u <= math.MaxUint16:
426 return mw.prefix16(muint16, uint16(u))
427 case u <= math.MaxUint32:
428 return mw.prefix32(muint32, uint32(u))
429 default:
430 return mw.prefix64(muint64, u)
431 }
432}
433
434// WriteByte is analogous to WriteUint8
435func (mw *Writer) WriteByte(u byte) error { return mw.WriteUint8(u) }

Callers 15

TestReadInt64BytesFunction · 0.95
TestReadUint64BytesFunction · 0.95
TestReadInt64Function · 0.95
TestReadIntOverflowsFunction · 0.95
TestReadUint64Function · 0.95
TestWriteUint64Function · 0.95
BenchmarkWriteUint64Function · 0.95
WriteUint8Method · 0.95

Calls 6

pushMethod · 0.95
prefix8Method · 0.95
prefix16Method · 0.95
prefix32Method · 0.95
prefix64Method · 0.95
wfixintFunction · 0.85

Tested by 13

TestReadInt64BytesFunction · 0.76
TestReadUint64BytesFunction · 0.76
TestReadInt64Function · 0.76
TestReadIntOverflowsFunction · 0.76
TestReadUint64Function · 0.76
TestWriteUint64Function · 0.76
BenchmarkWriteUint64Function · 0.76