Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BaseBuffer ¶ added in v1.6.0
func NewBaseBuffer ¶
func NewBaseBuffer(cap uint32, autoGrow bool) BaseBuffer
type BasePool ¶ added in v1.6.0
func NewBaseBufferPool ¶
func (*BasePool) Get ¶ added in v1.6.0
func (p *BasePool) Get() BaseBuffer
func (*BasePool) Put ¶ added in v1.6.0
func (p *BasePool) Put(b BaseBuffer)
type RReader ¶ added in v1.5.6
type RReader interface { io.Reader Peek() (first, end []byte) //查看,但不取出数据 PeekLen(outLen int) (first, end []byte, err error) PeekOut() (first, end []byte) //取出数据,但不做数据拷贝,有数据被覆盖风险 PeekOutLen(outLen int) (first, end []byte, err error) CopyOut(out []byte) int // 读取最大out长度的数据,返回读出数据长度 CopyOutLen(out []byte, outLen int) error // 读取outLen长度的数据,如果数据不足 outLen 返回 error // contains filtered or unexported methods }
type Reader ¶ added in v1.1.5
type Reader interface { io.Reader Peek() []byte //查看,但不取出数据 PeekLen(outLen int) ([]byte, error) PeekOut() []byte //取出数据,但不做数据拷贝,有数据被覆盖风险 PeekOutLen(outLen int) ([]byte, error) CopyOut(out []byte) int // 读取最大out长度的数据,返回读出数据长度 CopyOutLen(out []byte, outLen int) error // 读取outLen长度的数据,如果数据不足 outLen 返回 error // contains filtered or unexported methods }
type RingBuffer ¶ added in v1.5.6
func NewRingBuffer ¶ added in v1.5.6
func NewRingBuffer(cap uint32, autoGrow bool) RingBuffer
type RingPool ¶ added in v1.6.0
func NewRingBufferPool ¶ added in v1.5.6
func (*RingPool) Get ¶ added in v1.6.0
func (p *RingPool) Get() RingBuffer
func (*RingPool) Put ¶ added in v1.6.0
func (p *RingPool) Put(b RingBuffer)
type Writer ¶ added in v1.1.5
type Writer interface { io.Writer Clean() Reserve(cap int) error ResetLen(len int) AssignString(s string) error AssignBytes(p []byte) error AppendString(s string) error AppendBytes(p []byte) error // 将p写入 ringBuffer,如果 ringBuffer 不足,返回错误 GetTailEmptyBytes() []byte //与AddLen配合使用,用于需要转写数据的场景但又只有[]byte接口的地方,但需要注意,有可能尾部空间都有数据时,可能需要自行调用MoveHeadZeroRIndex释放空间 AddLen(len int) //与GetEmptyBytes配合使用 MoveHeadZeroRIndex() // contains filtered or unexported methods }
Click to show internal directories.
Click to hide internal directories.