NewWriter returns a new Writer writing to w.

The provided t is the type of object being written. The provided size is the number of uncompressed bytes being written.

Calling NewWriter causes it to immediately write header data containing size and type information. Any errors encountered in that process will be returned in err.

If an invalid t is provided, core.ErrInvalidType is returned. If a negative size is provided, ErrNegativeSize is returned.

The returned Writer implements io.WriteCloser. Close should be called when finished with the Writer. Close will not close the underlying io.Writer.

NewWriter is referenced in 1 repository