pub fn new(mut writer: W) -> Result<Writer<W>> {
        try!(writer.write_u32::<LittleEndian>(8));
        // TODO hardcoded version, make this smahtar.
        try!(writer.write_u16::<LittleEndian>(5));
        try!(writer.write_u16::<LittleEndian>(0));
        Ok(Writer { writer: writer })
    }
/// Creates a new writer, consuming the provided `Write`.
///
/// # Examples
///
/// ```
/// use std::fs::File;
/// use sdc::writer::Writer;
/// let writer = File::create("/dev/null").unwrap();
/// let writer = Writer::new(writer).unwrap();
Creates a new writer, consuming the provided `Write`.
Creates a new writer consuming the provided ` Write ` .
pub fn new(mut writer: W) -> Result<Writer<W>> {
        try!(writer.write_u32::<LittleEndian>(8));
        // TODO hardcoded version, make this smahtar.
        try!(writer.write_u16::<LittleEndian>(5));
        try!(writer.write_u16::<LittleEndian>(0));
        Ok(Writer { writer: writer })
    }
pub fn new ( mut writer : W ) -> Result < Writer < W > > { try ! ( writer write_u32 LittleEndian ( 8 ) ) ; // TODO hardcoded version, make this smahtar. try ! ( writer write_u16 LittleEndian ( 5 ) ) ; try ! ( writer write_u16 LittleEndian ( 0 ) ) ; Ok ( Writer { writer : writer } ) }
Creates a new writer, consuming the provided `Write`.
Creates a new writer consuming the provided ` Write ` .
writer
W
examples
```
use std::fs::File;
use sdc::writer::Writer;
let writer = File::create("/dev/null").unwrap();
let writer = Writer::new(writer).unwrap().
` ` ` use std :: fs :: File ; use sdc :: writer :: Writer ; let writer = File :: create ( " / dev / null " ) . unwrap () ; let writer = Writer :: new ( writer ) . unwrap () .