code: func NewWriter(writer io.Writer, header *FileHeader) (*Writer, error) {
  	w := &Writer{
  		writer: writer,
  		buf:    make([]byte, 24),
  	}
  	binary.LittleEndian.PutUint32(w.buf, header.MagicNumber)
  	binary.LittleEndian.PutUint16(w.buf[4:], header.VersionMajor)
  	binary.LittleEndian.PutUint16(w.buf[6:], header.VersionMinor)
  	binary.LittleEndian.PutUint32(w.buf[8:], uint32(header.TimeZone))
  	binary.LittleEndian.PutUint32(w.buf[12:], header.SigFigs)
  	binary.LittleEndian.PutUint32(w.buf[16:], header.SnapLen)
  	binary.LittleEndian.PutUint32(w.buf[20:], header.Network)
  	if _, err := writer.Write(w.buf); err != nil {
  		return nil, err
  	}
  	return w, nil
  }
docs: // NewWriter creates a Writer that stores output in an io.Writer.
  // The FileHeader is written immediately.