Documentation ¶
Overview ¶
Package brotli implements the brotli compressed data format.
Index ¶
Constants ¶
const ( BestSpeed = 0 BestCompression = 11 DefaultCompression = 6 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Reader ¶
type Reader struct {
// contains filtered or unexported fields
}
type Writer ¶
type Writer struct {
// contains filtered or unexported fields
}
func NewWriter ¶
NewWriter returns a new Writer. Writes to the returned writer are compressed and written to w.
It is the caller's responsibility to call Close on the Writer when done. Writes may be buffered and not flushed until Close.
func NewWriterLevel ¶
NewWriterLevel is like NewWriter but specifies the compression level instead of assuming DefaultCompression.
The compression level can be DefaultCompression or any integer value between BestSpeed and BestCompression inclusive. The error returned will be nil if the level is valid.
func (Writer) Close ¶
Close closes the Writer by flushing any unwritten data to the underlying io.Writer. It does not close the underlying io.Writer.
func (Writer) Flush ¶
Flush flushes any pending compressed data to the underlying writer.
It is useful mainly in compressed network protocols, to ensure that a remote reader has enough data to reconstruct a packet. Flush does not return until the data has been written. If the underlying writer returns an error, Flush returns that error.