pub fn write_bytes(&mut self, bytes: &[u8]) {
        self.flush_bit();

        let size = bytes.len() + self.wpos;

        if size > self.data.len() {
            self.resize(size);
        }

        for v in bytes {
            self.data[self.wpos] = *v;
            self.wpos += 1;
        }
    }
/// Append a byte array to the buffer. The buffer is automatically extended if needed
///
/// #Example
///
/// ```
/// # use databuffer::*;
/// let mut buffer = DataBuffer::new();
/// buffer.write_bytes(&vec![0x1, 0xFF, 0x45]); // buffer contains [0x1, 0xFF, 0x45]
/// ```
Append a byte array to the buffer. The buffer is automatically extended if needed
Append a byte array to the buffer . The buffer is automatically extended if needed
pub fn write_bytes(&mut self, bytes: &[u8]) {
        self.flush_bit();
        let size = bytes.len() + self.wpos;
        if size > self.data.len() {
            self.resize(size);
        }
        for v in bytes {
            self.data[self.wpos] = *v;
            self.wpos += 1;
        }
    }
pub fn write_bytes ( & mut self , bytes : & [ u8 ] ) { self . flush_bit ( ) ; let size = bytes . len ( ) + self . wpos ; if size > self . data . len ( ) { self . resize ( size ) ; } for v in bytes { self . data [ self . wpos ] = * v ; self . wpos += 1 ; } }
Append a byte array to the buffer.
Append a byte array to the buffer .
&mut self
bytes
&[u8]
example
None
use databuffer::*;
None