()
| 36 | } |
| 37 | |
| 38 | func (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 |
| 53 | func (m *String) DeserializeCDR(data []byte) error { |