Documentation
¶
Index ¶
- func AcquireBuffer() *bytes.Buffer
- func AcquireWriter(w io.Writer) *brotli.Writer
- func Encode(p []byte) ([]byte, error)
- func EncodeToBuffer(p []byte) (*bytes.Buffer, error)
- func EncodeToWriter(w io.Writer, p []byte) error
- func ReleaseBuffer(buf *bytes.Buffer)
- func ReleaseWriter(bw *brotli.Writer) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AcquireBuffer ¶
AcquireBuffer returns a pooled *bytes.Buffer with length 0.
func AcquireWriter ¶
AcquireWriter returns a pooled *brotli.Writer reset to write into w.
func Encode ¶
Encode compresses p and returns a standalone []byte. This is convenient but performs one allocation to detach from the pooled buffer.
func EncodeToBuffer ¶
EncodeToBuffer compresses p and returns a pooled buffer holding the result. The caller must call ReleaseBuffer on the returned buffer when done. No copy is made; safest for performance-critical paths where the caller controls lifetimes.
func EncodeToWriter ¶
EncodeToWriter compresses p and writes the result to w using a pooled writer. This path avoids allocations in hot code paths.
func ReleaseBuffer ¶
ReleaseBuffer returns the buffer to the pool.
func ReleaseWriter ¶
ReleaseWriter closes the writer (flushing final block) and returns it to the pool.
Types ¶
This section is empty.