Documentation
¶
Index ¶
- type Buffer
- func (r *Buffer[T]) AppendTo(s []T) []T
- func (r *Buffer[T]) Bytes() []T
- func (r *Buffer[T]) BytesSeq() iter.Seq[[]T]
- func (r *Buffer[T]) CopyTo(s []T) int
- func (r *Buffer[T]) Len() int
- func (r *Buffer[T]) MaxLen() int
- func (r *Buffer[T]) Write(b []T) (int, error)
- func (r *Buffer[T]) WriteByte(v T) error
- type ByteBuffer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Buffer ¶
type Buffer[T any] struct { // contains filtered or unexported fields }
func (*Buffer[T]) Bytes ¶
func (r *Buffer[T]) Bytes() []T
Bytes returns a copy of the contents of the buffer. If you want to access buffer data without copying/allocation, consider using Buffer.BytesSeq, Buffer.CopyTo or Buffer.AppendTo.
type ByteBuffer ¶
func NewByteBuffer ¶
func NewByteBuffer(maxLen int, initialCap ...int) *ByteBuffer
func (*ByteBuffer) String ¶
func (r *ByteBuffer) String() string
String returns the contents of the buffer as a string. If *ByteBuffer is nil, it returns "<nil>".
func (*ByteBuffer) WriteString ¶
func (r *ByteBuffer) WriteString(s string) (int, error)
Click to show internal directories.
Click to hide internal directories.