Documentation ¶
Index ¶
- type RingBuffer
- func (b *RingBuffer) Capacity() int
- func (b *RingBuffer) GetBuffers() []byte
- func (b *RingBuffer) IsEmpty() bool
- func (b *RingBuffer) IsFull() bool
- func (b *RingBuffer) Length() int
- func (b *RingBuffer) PeekAllBuffer() ([]byte, []byte)
- func (b *RingBuffer) PeekBuffer(len int) ([]byte, []byte, int)
- func (b *RingBuffer) PeekUint16() uint16
- func (b *RingBuffer) PeekUint32() uint32
- func (b *RingBuffer) PeekUint64() uint64
- func (b *RingBuffer) PeekUint8() uint8
- func (b *RingBuffer) ReadAllBuffer() []byte
- func (b *RingBuffer) ReadBuffer(data []byte) (int, error)
- func (b *RingBuffer) Retrieve(length int)
- func (b *RingBuffer) RetrieveAll()
- func (b *RingBuffer) VirtualFlush()
- func (b *RingBuffer) VirtualLength() int
- func (b *RingBuffer) VirtualRead(data []byte) (int, error)
- func (b *RingBuffer) VirtualRevert()
- func (b *RingBuffer) WriteBuffer(data []byte) (int, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RingBuffer ¶
type RingBuffer struct {
// contains filtered or unexported fields
}
func NewBuffer ¶
func NewBuffer(size int) *RingBuffer
func (*RingBuffer) GetBuffers ¶
func (b *RingBuffer) GetBuffers() []byte
GetBuffers 返回buffer所有可读数据, 不移动读位置,仅仅是拷贝全部数据
func (*RingBuffer) PeekAllBuffer ¶
func (b *RingBuffer) PeekAllBuffer() ([]byte, []byte)
PeekAllBuffer 预读buffer,不移动读取位置
func (*RingBuffer) PeekBuffer ¶
func (b *RingBuffer) PeekBuffer(len int) ([]byte, []byte, int)
PeekBuffer 预读buffer,不移动读取位置
func (*RingBuffer) PeekUint16 ¶
func (b *RingBuffer) PeekUint16() uint16
func (*RingBuffer) PeekUint32 ¶
func (b *RingBuffer) PeekUint32() uint32
func (*RingBuffer) PeekUint64 ¶
func (b *RingBuffer) PeekUint64() uint64
func (*RingBuffer) PeekUint8 ¶
func (b *RingBuffer) PeekUint8() uint8
func (*RingBuffer) ReadBuffer ¶
func (b *RingBuffer) ReadBuffer(data []byte) (int, error)
ReadBuffer 读取buffer
func (*RingBuffer) VirtualRead ¶
func (b *RingBuffer) VirtualRead(data []byte) (int, error)
func (*RingBuffer) WriteBuffer ¶
func (b *RingBuffer) WriteBuffer(data []byte) (int, error)
WriteBuffer 写入buffer
Click to show internal directories.
Click to hide internal directories.