MCPcopy Index your code
hub / github.com/dropbox/godropbox / writeBinary

Function writeBinary

database/sqltypes/sqltypes.go:452–461  ·  view source on GitHub ↗
(typ ValueType, data []byte)

Source from the content-addressed store, hash-verified

450}
451
452func writeBinary(typ ValueType, data []byte) ([]byte, error) {
453 var scratch [binary.MaxVarintLen64]byte
454 n := binary.PutUvarint(scratch[:], uint64(len(data)))
455
456 var buf bytes.Buffer
457 buf.WriteByte(byte(typ))
458 buf.Write(scratch[:n])
459 buf.Write(data)
460 return buf.Bytes(), nil
461}
462
463func (n Numeric) raw() []byte {
464 return []byte(n)

Callers 3

MarshalBinaryMethod · 0.85
MarshalBinaryMethod · 0.85
MarshalBinaryMethod · 0.85

Calls 2

BytesMethod · 0.65
WriteMethod · 0.45

Tested by

no test coverage detected