/// Create a new write stream
///
/// must assert data.len() is enough
Create a new write stream
must assert data.len() is enough
Create a new write stream must assert data . len () is enough
pub unsafe fn from_slice(data: &'a mut [u8], endianness: E) -> Self {
        let p = data.as_mut_ptr();
        let cap = data.len();
        let slice = Rc::new(Vec::from_raw_parts(p, 0, cap));
        let data = &mut *(Rc::as_ptr(&slice) as *mut Vec<u8>);
        BitWriteStream {
            buffer: WriteBuffer::new(data, endianness),
            slice: Some(slice),
        }
    }
pub unsafe fn from_slice ( data : & ' a mut [ u8 ] , endianness : E ) -> Self { let p = data . as_mut_ptr ( ) ; let cap = data . len ( ) ; let slice = Rc :: new ( Vec :: from_raw_parts ( p , 0 , cap ) ) ; let data = & mut * ( Rc :: as_ptr ( & slice ) as * mut Vec < u8 > ) ; BitWriteStream { buffer : WriteBuffer :: new ( data , endianness ) , slice : Some ( slice ) , } }
Create a new write stream
must assert data.len() is enough
Create a new write stream must assert data . len () is enough
data
&'a mut [u8]
endianness
E