pub fn new(mut write: W, mut header: Header) -> Result<Writer<W>> {
        let start = write.seek(SeekFrom::Current(0))?;
        header.clear();
        header.clone().into_raw().and_then(|raw_header| {
            raw_header.write_to(&mut write)
        })?;
        for vlr in header.vlrs() {
            (*vlr).clone().into_raw(false).and_then(|raw_vlr| {
                raw_vlr.write_to(&mut write)
            })?;
        }
        if !header.vlr_padding().is_empty() {
            write.write_all(&header.vlr_padding())?;
        }
        Ok(Writer {
            closed: false,
            header: header,
            start: start,
            write: write,
        })
    }
/// Creates a new writer.
///
/// The header that is passed in will have various fields zero'd, e.g. bounds, number of
/// points, etc.
///
/// # Examples
///
/// ```
/// use std::io::Cursor;
/// use las::Writer;
/// let writer = Writer::new(Cursor::new(Vec::new()), Default::default());
/// ```
Creates a new writer.
The header that is passed in will have various fields zero'd, e.g. bounds, number of
points, etc.
Creates a new writer . The header that is passed in will have various fields zero ' d e . g . bounds number of points etc .
pub fn new(mut write: W, mut header: Header) -> Result<Writer<W>> {
        let start = write.seek(SeekFrom::Current(0))?;
        header.clear();
        header.clone().into_raw().and_then(|raw_header| {
            raw_header.write_to(&mut write)
        })?;
        for vlr in header.vlrs() {
            (*vlr).clone().into_raw(false).and_then(|raw_vlr| {
                raw_vlr.write_to(&mut write)
            })?;
        }
        if !header.vlr_padding().is_empty() {
            write.write_all(&header.vlr_padding())?;
        }
        Ok(Writer {
            closed: false,
            header: header,
            start: start,
            write: write,
        })
    }
pub fn new ( mut write : W , mut header : Header ) -> Result < Writer < W > > { let start = write . seek ( SeekFrom :: Current ( 0 ) ) ? ; header . clear ( ) ; header . clone ( ) . into_raw ( ) . and_then ( | raw_header | { raw_header . write_to ( & mut write ) } ) ? ; for vlr in header . vlrs ( ) { ( * vlr ) . clone ( ) . into_raw ( false ) . and_then ( | raw_vlr | { raw_vlr . write_to ( & mut write ) } ) ? ; } if ! header . vlr_padding ( ) . is_empty ( ) { write . write_all ( & header . vlr_padding ( ) ) ? ; } Ok ( Writer { closed : false , header : header , start : start , write : write , } ) }
Creates a new writer.
Creates a new writer .
write
W
header
Header
examples
```
use std::io::Cursor;
use las::Writer;
let writer = Writer::new(Cursor::new(Vec::new()), Default::default());
```
` ` ` use std :: io :: Cursor ; use las :: Writer ; let writer = Writer :: new ( Cursor :: new ( Vec :: new () ) Default :: default () ) ; ` ` `