Marshal serializes the frame to a byte slice using the schema: session_id : 16 bytes seq : uint64 BE flags : uint8 target_len : uint8 target : N bytes payload_len : uint32 BE payload : N bytes
()
| 48 | // payload_len : uint32 BE |
| 49 | // payload : N bytes |
| 50 | func (f *Frame) Marshal() ([]byte, error) { |
| 51 | return f.AppendMarshal(make([]byte, 0, f.EncodedLen())) |
| 52 | } |
| 53 | |
| 54 | func (f *Frame) AppendMarshal(dst []byte) ([]byte, error) { |
| 55 | if len(f.Target) > maxTargetLen { |