pub fn encode_raw_to_buf( frame: &RawFrame, buf: &mut Vec<u8>, ) -> ProtocolResult<()>
Encodes a raw frame to a byte buffer using the length-prefixed format.
Frame format: [len: u32 BE][id: u32 BE][flags: u8][body...]
[len: u32 BE][id: u32 BE][flags: u8][body...]