// Close closes the writer and adds the footer to the Writer. Close
// doesn't close the underlying writer.

Close closes the writer and adds the footer to the Writer. Close
doesn't close the underlying writer.
// Close closes the writer and adds the footer to the Writer . Close // doesn ' t close the underlying writer .
func (w *Writer) Close() error {
	if w.closed {
		return errClosed
	}
	w.closed = true
	var err error
	if err = w.closeBlockWriter(); err != nil {
		return err
	}
	f := footer{flags: w.h.flags}
	if f.indexSize, err = writeIndex(w.xz, w.index); err != nil {
		return err
	}
	data, err := f.MarshalBinary()
	if err != nil {
		return err
	}
	if _, err = w.xz.Write(data); err != nil {
		return err
	}
	return nil
}
func ( w * Writer ) Close ( ) error { if w . closed { return errClosed } w . closed = true var err error if err = w . closeBlockWriter ( ) ; err != nil { return err } f := footer { flags : w . h . flags } if f . indexSize , err = writeIndex ( w . xz , w . index ) ; err != nil { return err } data , err := f . MarshalBinary ( ) if err != nil { return err } if _ , err = w . xz . Write ( data ) ; err != nil { return err } return nil }
Close closes the writer and adds the footer to the Writer.
Close closes the writer and adds the footer to the Writer .