MCPcopy Create free account
hub / github.com/ZettaScaleLabs/hiroz / packToRaw

Method packToRaw

crates/hiroz-go/testdata/string_msg.go:38–50  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

36}
37
38func (m *String) packToRaw() []byte {
39 buf := make([]byte, 0, 256)
40 // Pack string: Data
41 {
42 data := []byte(m.Data)
43 lenBytes := make([]byte, 4)
44 binary.LittleEndian.PutUint32(lenBytes, uint32(len(data)+1))
45 buf = append(buf, lenBytes...)
46 buf = append(buf, data...)
47 buf = append(buf, 0) // null terminator
48 }
49 return buf
50}
51
52// DeserializeCDR deserializes CDR data into the message
53func (m *String) DeserializeCDR(data []byte) error {

Callers 1

SerializeCDRMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected