Documentation ¶
Index ¶
- func Copy(dst io.Writer, src io.Reader) (written int64, err error)
- func GetBufferWriter(writer io.Writer) *bufio.Writer
- func GetBufioReader(reader io.Reader) *bufio.Reader
- func GetByteSlice() *[]byte
- func GetBytesBuffer() *bytes.Buffer
- func GetZlibWriter(w io.Writer) *zlib.Writer
- func GrowReadMax(r io.Reader, n int64, grow int) ([]byte, error)
- func LargeCopy(dst io.Writer, src io.Reader) (written int64, err error)
- func PutBufferWriter(writer *bufio.Writer)
- func PutBufioReader(reader *bufio.Reader)
- func PutByteSlice(buf *[]byte)
- func PutBytesBuffer(buf *bytes.Buffer)
- func PutZlibReader(z *ZLibReader)
- func PutZlibWriter(w *zlib.Writer)
- func PutZstdReader(z *ZstdDecoder)
- func PutZstdWriter(w *ZstdEncoder)
- func ReadMax(r io.Reader, n int64) ([]byte, error)
- type ZLibReader
- type ZstdDecoder
- type ZstdEncoder
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetBufferWriter ¶
GetBufferWriter returns a *bufio.Writer that is managed by a sync.Pool. Returns a bufio.Writer that is reset with writer and ready for use.
After use, the *bufio.Writer should be put back into the sync.Pool by calling PutBufferWriter.
func GetBufioReader ¶
GetBufioReader returns a *bufio.Reader that is managed by a sync.Pool. Returns a bufio.Reader that is reset with reader and ready for use.
After use, the *bufio.Reader should be put back into the sync.Pool by calling PutBufioReader.
func GetByteSlice ¶
func GetByteSlice() *[]byte
GetByteSlice returns a *[]byte that is managed by a sync.Pool. The initial slice length will be 16384 (16kb).
After use, the *[]byte should be put back into the sync.Pool by calling PutByteSlice.
func GetBytesBuffer ¶
GetBytesBuffer returns a *bytes.Buffer that is managed by a sync.Pool. Returns a buffer that is reset and ready for use.
After use, the *bytes.Buffer should be put back into the sync.Pool by calling PutBytesBuffer.
func GetZlibWriter ¶
GetZlibWriter returns a *zlib.Writer that is managed by a sync.Pool. Returns a writer that is reset with w and ready for use.
After use, the *zlib.Writer should be put back into the sync.Pool by calling PutZlibWriter.
func PutBufferWriter ¶
PutBufferWriter puts reader back into its sync.Pool.
func PutBufioReader ¶
PutBufioReader puts reader back into its sync.Pool.
func PutBytesBuffer ¶
PutBytesBuffer puts buf back into its sync.Pool.
func PutZlibReader ¶
func PutZlibReader(z *ZLibReader)
PutZlibReader puts z back into its sync.Pool, first closing the reader. The Byte slice dictionary is also put back into its sync.Pool.
func PutZlibWriter ¶
PutZlibWriter puts w back into its sync.Pool.
func PutZstdReader ¶
func PutZstdReader(z *ZstdDecoder)
PutZstdReader puts z back into its sync.Pool, first closing the reader. The Byte slice dictionary is also put back into its sync.Pool.
func PutZstdWriter ¶
func PutZstdWriter(w *ZstdEncoder)
PutZstdWriter puts w back into its sync.Pool.
Types ¶
type ZLibReader ¶
type ZLibReader struct { Reader zlibReadCloser // contains filtered or unexported fields }
func GetZlibReader ¶
func GetZlibReader(r io.Reader) (*ZLibReader, error)
GetZlibReader returns a ZLibReader that is managed by a sync.Pool. Returns a ZLibReader that is reset using a dictionary that is also managed by a sync.Pool.
After use, the ZLibReader should be put back into the sync.Pool by calling PutZlibReader.
type ZstdDecoder ¶
func GetZstdReader ¶
func GetZstdReader(r io.Reader) (*ZstdDecoder, error)
GetZstdReader returns a ZstdDecoder that is managed by a sync.Pool. Returns a ZLibReader that is reset using a dictionary that is also managed by a sync.Pool.
After use, the ZstdDecoder should be put back into the sync.Pool by calling PutZstdReader.
type ZstdEncoder ¶
func GetZstdWriter ¶
func GetZstdWriter(w io.Writer) *ZstdEncoder
GetZstdWriter returns a *ztsd.Encoder that is managed by a sync.Pool. Returns a writer that is reset with w and ready for use.
After use, the *ztsd.Encoder should be put back into the sync.Pool by calling PutZstdWriter.