Comment on Serialization Format
This commit is contained in:
parent
ea9cf5ca87
commit
a088e588b1
|
@ -18,6 +18,7 @@ type PeerMessage struct {
|
|||
}
|
||||
|
||||
// Serialize constructs an efficient serialized representation
|
||||
// Format: [ID String] | [Context String] | Binary Data
|
||||
func (m *PeerMessage) Serialize() []byte {
|
||||
return append(append([]byte(m.ID+"|"), []byte(m.Context+"|")...), m.Data...)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue