Documentation
¶
Overview ¶
Package snappy provides a reader and writer that propagate calls to Flush and Close.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ReadResetter ¶
func ReadBytes ¶
func ReadBytes(b []byte) ReadResetter
ReadBytes returns a reader for reading snappy-compressed bytes from an input slice. b is the input slice of compressed bytes.
type Reader ¶
type Reader struct {
// contains filtered or unexported fields
}
func NewReader ¶
func NewReader(r io.ReadCloser) *Reader
NewReader returns a new Reader that decompresses from r, using the framing format described at https://github.com/google/snappy/blob/master/framing_format.txt
func (*Reader) Reset ¶
func (r *Reader) Reset(reader io.ReadCloser)
type Writer ¶
func NewBufferedWriter ¶
func NewBufferedWriter(w io.WriteCloser) *Writer
NewBufferedWriter returns a new Writer that compresses to w, using the framing format described at https://github.com/google/snappy/blob/master/framing_format.txt
The Writer returned buffers writes. Users must call Close to guarantee all data has been forwarded to the underlying io.Writer. They may also call Flush zero or more times before calling Close.
func (*Writer) Close ¶
Close closes the snppy.Writer, and then flushes and closes the underlying io.WriteCloser.
func (*Writer) Flush ¶
Flush writes any pending data to the underlying io.Writer. Then calls the "Flush() error" method of the underlying writer, if it implements it.
func (*Writer) Reset ¶
func (w *Writer) Reset(writer io.WriteCloser)
Reset discards the writer's state and switches the Snappy writer to write to w. This permits reusing a Writer rather than allocating a new one