Documentation ¶
Overview ¶
Go wrapper for the Brotli C decoder implementation
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecompressBuffer ¶
Decompress a Brotli-encoded buffer. Uses decodedBuffer as the destination buffer unless it is too small, in which case a new buffer is allocated. Returns the slice of the decodedBuffer containing the output, or an error.
Types ¶
type BrotliReader ¶
type BrotliReader struct {
// contains filtered or unexported fields
}
Decompresses a Brotli-encoded stream using the io.Reader interface
func NewBrotliReader ¶
func NewBrotliReader(stream io.Reader) *BrotliReader
Returns a Reader that decompresses the stream from another reader.
Ensure that you Close the stream when you are finished in order to clean up the Brotli decompression state.
The internal decompression buffer defaults to 128kb
func NewBrotliReaderSize ¶
func NewBrotliReaderSize(stream io.Reader, size int) *BrotliReader
The same as NewBrotliReader, but allows the internal buffer size to be set.
The size of the internal buffer may be specified which will hold compressed data before being read by the decompressor
func (*BrotliReader) Close ¶
func (r *BrotliReader) Close() error
Close the reader and clean up any decompressor state.
type CBrotliState ¶
don't let the go 1.5.1 GC put its dirty paws in our beautiful C struct (#14) cf. https://github.com/youtube/vitess/blob/071d0e649f22034ad4285c7431ac0a2c9c20090d/go/cgzip/zstream.go#L86-L89