unshuffle_buf

Function unshuffle_buf 

Source
pub fn unshuffle_buf(typesize: usize, src: &[u8], buf: BorrowedCursor<'_>)
Available on crate feature nightly only.
Expand description

Like unshuffle_into, but works with uninitialized output buffers.

ยงExample

#![cfg_attr(feature = "nightly", feature(core_io_borrowed_buf))]
use byteshuffle::*;
use std::io::BorrowedBuf;
use std::mem::MaybeUninit;

const IN: [u8; 8] = [0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04];
let mut outvec = [MaybeUninit::uninit(); 8];
let mut buf = BorrowedBuf::from(&mut outvec[..]);
unshuffle_buf(2, &IN, buf.unfilled());
assert_eq!(buf.filled(), [0x00, 0x01, 0x00, 0x02, 0x00, 0x03, 0x00, 0x04]);