Skip to main content

write_bytes

Function write_bytes 

Source
pub fn write_bytes(out: &mut Vec<u8>, bytes: &[u8]) -> Result<(), WireError>
Expand description

Append a u32 length prefix followed by the bytes verbatim. Returns LengthOverflow without changing out if the slice length exceeds u32::MAX. Read the prefix with WireCursor::read_len and the payload with WireCursor::read_exact.