Documentation ¶
Index ¶
- func DefaultSize() int
- func PutBuffer(buffer *ByteBuffer)
- func RegisterPool(size int)
- func SetDefaultSize(size int)
- type ByteBuffer
- func (buffer ByteBuffer) Buf() []byte
- func (buffer ByteBuffer) Cap() int
- func (buffer *ByteBuffer) Clear()
- func (buffer ByteBuffer) Clone() (newBuffer *ByteBuffer)
- func (buffer ByteBuffer) Cut() []byte
- func (buffer ByteBuffer) Data() []byte
- func (buffer *ByteBuffer) MarshalJSON() (b []byte, err error)
- func (buffer *ByteBuffer) Move(step int) (err error)
- func (buffer *ByteBuffer) SetString(data string) (err error)
- func (buffer ByteBuffer) String() string
- func (buffer *ByteBuffer) UnmarshalJSON(b []byte) (err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ByteBuffer ¶
ByteBuffer bytes缓冲器
func GetBuffer ¶
func GetBuffer(size ...int) (buffer *ByteBuffer)
GetBuffer 尝试从Buffer池获取Buffer,如果size参数为空,尺寸为defaultSize
func GetBytesBuffer ¶
func GetBytesBuffer(b []byte) (buffer *ByteBuffer)
GetBytesBuffer 尝试从Buffer池获取Buffer,并拷入b的数据
func GetStringBuffer ¶
func GetStringBuffer(str string) (buffer *ByteBuffer)
GetStringBuffer 尝试从Buffer池获取Buffer,并拷入str的数据
func (ByteBuffer) Clone ¶
func (buffer ByteBuffer) Clone() (newBuffer *ByteBuffer)
Clone 克隆一个新的ByteBuffer
func (*ByteBuffer) MarshalJSON ¶
func (buffer *ByteBuffer) MarshalJSON() (b []byte, err error)
MarshalJSON JSON序列化器
func (*ByteBuffer) Move ¶
func (buffer *ByteBuffer) Move(step int) (err error)
Move 将数据部分的起点后移step距离,当step为负数,则为前移
func (*ByteBuffer) SetString ¶
func (buffer *ByteBuffer) SetString(data string) (err error)
SetString 将Buffer的值设置为字符串
func (*ByteBuffer) UnmarshalJSON ¶
func (buffer *ByteBuffer) UnmarshalJSON(b []byte) (err error)
UnmarshalJSON JSON反序列化器
Click to show internal directories.
Click to hide internal directories.