Documentation ¶
Overview ¶
Package bufferwritter provides a contentWriter implementation using a shared buffer pool for memory management.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BufferWriter ¶
type BufferWriter struct {
// contains filtered or unexported fields
}
BufferWriter implements contentWriter, using a shared buffer pool for memory management.
func (*BufferWriter) CloseForWriting ¶
func (b *BufferWriter) CloseForWriting() error
CloseForWriting is a no-op for buffer, as there is no resource cleanup needed for bytes.Buffer.
func (*BufferWriter) Len ¶
func (b *BufferWriter) Len() int
Len returns the length of the buffer's content.
func (*BufferWriter) ReadCloser ¶
func (b *BufferWriter) ReadCloser() (io.ReadCloser, error)
ReadCloser provides a read-closer for the buffer's content. It wraps the buffer's content in a NopCloser to provide a ReadCloser without additional closing behavior, as closing a bytes.Buffer is a no-op.
func (*BufferWriter) String ¶
func (b *BufferWriter) String() (string, error)
String returns the buffer's content as a string.
Click to show internal directories.
Click to hide internal directories.