pub(crate) fn write_varlen_slice<W: Write>(slice: &[u8], out: &mut W) -> WriteResult<W> {
    let len = u32::try_from(slice.len())
        .ok()
        .and_then(u28::try_from)
        .ok_or_else(|| W::invalid_input("varlen slice exceeds 28 bits"))?;
    len.write_varlen(out)?;
    out.write(slice)?;
    Ok(())
}
/// Write a slice represented as a varlen `u28` as its length and then the raw bytes.
Write a slice represented as a varlen `u28` as its length and then the raw bytes.
Write a slice represented as a varlen ` u28 ` as its length and then the raw bytes .
pub(crate) fn write_varlen_slice<W: Write>(slice: &[u8], out: &mut W) -> WriteResult<W> {
    let len = u32::try_from(slice.len())
        .ok()
        .and_then(u28::try_from)
        .ok_or_else(|| W::invalid_input("varlen slice exceeds 28 bits"))?;
    len.write_varlen(out)?;
    out.write(slice)?;
    Ok(())
}
pub ( crate ) fn write_varlen_slice < W : Write > ( slice : & [ u8 ] , out : & mut W ) -> WriteResult < W > { let len = u32 :: try_from ( slice . len ( ) ) . ok ( ) . and_then ( u28 :: try_from ) . ok_or_else ( | | W :: invalid_input ( " " ) ) ? ; len . write_varlen ( out ) ? ; out . write ( slice ) ? ; Ok ( ( ) ) }
Write a slice represented as a varlen `u28` as its length and then the raw bytes.
Write a slice represented as a varlen ` u28 ` as its length and then the raw bytes .
slice
&[u8]
out
&mut W
slice
&[u8]
out
&mut W