Documentation ¶
Overview ¶
Package bytes2 provides alternate implementations of functionality similar to go's bytes package.
Index ¶
- type ChunkedWriter
- func (cw *ChunkedWriter) Bytes() (b []byte)
- func (cw *ChunkedWriter) Len() int
- func (cw *ChunkedWriter) Reserve(n int) (b []byte)
- func (cw *ChunkedWriter) Reset()
- func (cw *ChunkedWriter) Truncate(n int)
- func (cw *ChunkedWriter) Write(p []byte) (n int, err error)
- func (cw *ChunkedWriter) WriteByte(c byte) error
- func (cw *ChunkedWriter) WriteRune(r rune) (n int, err error)
- func (cw *ChunkedWriter) WriteString(p string) (n int, err error)
- func (cw *ChunkedWriter) WriteTo(w io.Writer) (n int64, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChunkedWriter ¶
type ChunkedWriter struct {
// contains filtered or unexported fields
}
ChunkedWriter has the same interface as bytes.Buffer's write functions. It additionally provides a Reserve function that returns a []byte that the caller can directly change.
func NewChunkedWriter ¶
func NewChunkedWriter(chunkSize int) *ChunkedWriter
func (*ChunkedWriter) Bytes ¶
func (cw *ChunkedWriter) Bytes() (b []byte)
Bytes This function can get expensive for large buffers.
func (*ChunkedWriter) Len ¶
func (cw *ChunkedWriter) Len() int
func (*ChunkedWriter) Reserve ¶
func (cw *ChunkedWriter) Reserve(n int) (b []byte)
func (*ChunkedWriter) Reset ¶
func (cw *ChunkedWriter) Reset()
func (*ChunkedWriter) Truncate ¶
func (cw *ChunkedWriter) Truncate(n int)
func (*ChunkedWriter) WriteByte ¶
func (cw *ChunkedWriter) WriteByte(c byte) error
func (*ChunkedWriter) WriteString ¶
func (cw *ChunkedWriter) WriteString(p string) (n int, err error)
Click to show internal directories.
Click to hide internal directories.