Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ZstdReader ¶
type ZstdReader struct {
// contains filtered or unexported fields
}
zstdReader is an optimized wrapper of zstd.Decoder with sync.Pool support.
func NewZstdReader ¶
func NewZstdReader(r io.Reader) *ZstdReader
NewZstdReader returns a new zstd Reader with the given io.Reader.
func (*ZstdReader) Close ¶
func (zr *ZstdReader) Close() error
Close will reset the decoder the supplied stream after the current has finished processing, and close the underlying io.Reader if it implemented io.Closer. The Reader can not be reused after Close.
func (*ZstdReader) Read ¶
func (zr *ZstdReader) Read(p []byte) (n int, err error)
Read reads data from the underlying io.Reader and decompresses it.
func (*ZstdReader) Reset ¶
func (zr *ZstdReader) Reset()
Reset will reset the decoder the supplied stream after the current has finished processing, it does not close the underlying io.Writer.
type ZstdWriter ¶
type ZstdWriter struct {
// contains filtered or unexported fields
}
ZstdWriter is an optimized wrapper of zstd.Encoder with sync.Pool support.
func NewZstdWriter ¶
func NewZstdWriter(w io.Writer) *ZstdWriter
NewZstdWriter returns a new zstd Writer with the given io.Writer.
func (*ZstdWriter) Close ¶
func (zw *ZstdWriter) Close() error
Close closes the Writer, flushing any unwritten data to the underlying io.Writer. and close the underlying io.Writer if it implemented io.Closer. The Writer can not be reused after Close.
func (*ZstdWriter) Reset ¶
func (zw *ZstdWriter) Reset()
Reset closes the Writer, flushing any unwritten data to the underlying io.Writer. but does not close the underlying io.Writer. The Writer can not be reused after Reset.