Struct dribble::DribbleWriter
[-] [+]
[src]
pub struct DribbleWriter<W: Write> { // some fields omitted }
Wrap an implementation of Write
, and pass through bytes in small,
random-sized chunks when write
is called.
use std::io::Write; use dribble::DribbleWriter; let input = b"This is my test data"; let mut output = vec!(); { let mut dribble = DribbleWriter::new(&mut output); dribble.write(input).unwrap(); } assert_eq!(input as &[u8], &output as &[u8]);
Methods
impl<W: Write> DribbleWriter<W>
fn new(dest: W) -> Self
Create a new DribbleWriter
.