Documentation
¶
Index ¶
- Variables
- func BytesCombine(pBytes ...[]byte) []byte
- func BytesToString(p []byte) string
- type BigEndianStreamImpl
- func (impl *BigEndianStreamImpl) CleanBuff() error
- func (impl *BigEndianStreamImpl) CopyBuff(b []byte) error
- func (impl *BigEndianStreamImpl) Data() []byte
- func (impl *BigEndianStreamImpl) Length() int
- func (impl *BigEndianStreamImpl) PeekBuff(size int) (buff []byte, err error)
- func (impl *BigEndianStreamImpl) ReadBuff(size int) (buff []byte, err error)
- func (impl *BigEndianStreamImpl) ReadByte() (b byte, err error)
- func (impl *BigEndianStreamImpl) ReadUint16() (b uint16, err error)
- func (impl *BigEndianStreamImpl) ReadUint32() (b uint32, err error)
- func (impl *BigEndianStreamImpl) ReadUint64() (b uint64, err error)
- func (impl *BigEndianStreamImpl) Reset(buff []byte)
- func (impl *BigEndianStreamImpl) Right() int
- func (impl *BigEndianStreamImpl) Size() int
- func (impl *BigEndianStreamImpl) WriteBuff(buff []byte) error
- func (impl *BigEndianStreamImpl) WriteByte(b byte) error
- func (impl *BigEndianStreamImpl) WriteUint16(b uint16) error
- func (impl *BigEndianStreamImpl) WriteUint32(b uint32) error
- func (impl *BigEndianStreamImpl) WriteUint64(b uint64) error
- type IReadStream
- type IWriteStream
- type LittleEndianStreamImpl
- func (impl *LittleEndianStreamImpl) CleanBuff() error
- func (impl *LittleEndianStreamImpl) CopyBuff(b []byte) error
- func (impl *LittleEndianStreamImpl) Data() []byte
- func (impl *LittleEndianStreamImpl) Length() int
- func (impl *LittleEndianStreamImpl) PeekBuff(size int) (buff []byte, err error)
- func (impl *LittleEndianStreamImpl) ReadBuff(size int) (buff []byte, err error)
- func (impl *LittleEndianStreamImpl) ReadByte() (b byte, err error)
- func (impl *LittleEndianStreamImpl) ReadUint16() (b uint16, err error)
- func (impl *LittleEndianStreamImpl) ReadUint32() (b uint32, err error)
- func (impl *LittleEndianStreamImpl) ReadUint64() (b uint64, err error)
- func (impl *LittleEndianStreamImpl) Reset(buff []byte)
- func (impl *LittleEndianStreamImpl) Right() int
- func (impl *LittleEndianStreamImpl) Size() int
- func (impl *LittleEndianStreamImpl) WriteBuff(buff []byte) error
- func (impl *LittleEndianStreamImpl) WriteByte(b byte) error
- func (impl *LittleEndianStreamImpl) WriteUint16(b uint16) error
- func (impl *LittleEndianStreamImpl) WriteUint32(b uint32) error
- func (impl *LittleEndianStreamImpl) WriteUint64(b uint64) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrBuffOverflow = fmt.Errorf("剩余的缓存空间不足")
Functions ¶
Types ¶
type BigEndianStreamImpl ¶
type BigEndianStreamImpl struct {
// contains filtered or unexported fields
}
func NewBigEndianStream ¶
func NewBigEndianStream(buff []byte) *BigEndianStreamImpl
func (*BigEndianStreamImpl) CleanBuff ¶
func (impl *BigEndianStreamImpl) CleanBuff() error
*
- 将已经读取过的数据从缓存中清除
func (*BigEndianStreamImpl) CopyBuff ¶
func (impl *BigEndianStreamImpl) CopyBuff(b []byte) error
func (*BigEndianStreamImpl) Data ¶
func (impl *BigEndianStreamImpl) Data() []byte
func (*BigEndianStreamImpl) Length ¶
func (impl *BigEndianStreamImpl) Length() int
func (*BigEndianStreamImpl) PeekBuff ¶
func (impl *BigEndianStreamImpl) PeekBuff(size int) (buff []byte, err error)
*
- 从缓存中预读取指定字节数据不修改pos
func (*BigEndianStreamImpl) ReadBuff ¶
func (impl *BigEndianStreamImpl) ReadBuff(size int) (buff []byte, err error)
func (*BigEndianStreamImpl) ReadByte ¶
func (impl *BigEndianStreamImpl) ReadByte() (b byte, err error)
func (*BigEndianStreamImpl) ReadUint16 ¶
func (impl *BigEndianStreamImpl) ReadUint16() (b uint16, err error)
func (*BigEndianStreamImpl) ReadUint32 ¶
func (impl *BigEndianStreamImpl) ReadUint32() (b uint32, err error)
func (*BigEndianStreamImpl) ReadUint64 ¶
func (impl *BigEndianStreamImpl) ReadUint64() (b uint64, err error)
func (*BigEndianStreamImpl) Reset ¶
func (impl *BigEndianStreamImpl) Reset(buff []byte)
func (*BigEndianStreamImpl) Right ¶
func (impl *BigEndianStreamImpl) Right() int
func (*BigEndianStreamImpl) Size ¶
func (impl *BigEndianStreamImpl) Size() int
func (*BigEndianStreamImpl) WriteBuff ¶
func (impl *BigEndianStreamImpl) WriteBuff(buff []byte) error
func (*BigEndianStreamImpl) WriteByte ¶
func (impl *BigEndianStreamImpl) WriteByte(b byte) error
func (*BigEndianStreamImpl) WriteUint16 ¶
func (impl *BigEndianStreamImpl) WriteUint16(b uint16) error
func (*BigEndianStreamImpl) WriteUint32 ¶
func (impl *BigEndianStreamImpl) WriteUint32(b uint32) error
func (*BigEndianStreamImpl) WriteUint64 ¶
func (impl *BigEndianStreamImpl) WriteUint64(b uint64) error
type IReadStream ¶
type IReadStream interface { Size() int // 缓存空间大小 Length() int // 已使用的长度 Right() int // 剩余空间大小 Reset([]byte) Data() []byte ReadByte() (b byte, err error) ReadUint16() (b uint16, err error) ReadUint32() (b uint32, err error) ReadUint64() (b uint64, err error) ReadBuff(size int) (b []byte, err error) PeekBuff(size int) (buff []byte, err error) CopyBuff(b []byte) error }
type IWriteStream ¶
type LittleEndianStreamImpl ¶
type LittleEndianStreamImpl struct {
// contains filtered or unexported fields
}
func NewLittleEndianStream ¶
func NewLittleEndianStream(buff []byte) *LittleEndianStreamImpl
func (*LittleEndianStreamImpl) CleanBuff ¶
func (impl *LittleEndianStreamImpl) CleanBuff() error
*
- 将已经读取过的数据从缓存中清除
func (*LittleEndianStreamImpl) CopyBuff ¶
func (impl *LittleEndianStreamImpl) CopyBuff(b []byte) error
func (*LittleEndianStreamImpl) Data ¶
func (impl *LittleEndianStreamImpl) Data() []byte
func (*LittleEndianStreamImpl) Length ¶
func (impl *LittleEndianStreamImpl) Length() int
func (*LittleEndianStreamImpl) PeekBuff ¶
func (impl *LittleEndianStreamImpl) PeekBuff(size int) (buff []byte, err error)
*
- 从缓存中预读取指定字节数据不修改pos
func (*LittleEndianStreamImpl) ReadBuff ¶
func (impl *LittleEndianStreamImpl) ReadBuff(size int) (buff []byte, err error)
func (*LittleEndianStreamImpl) ReadByte ¶
func (impl *LittleEndianStreamImpl) ReadByte() (b byte, err error)
func (*LittleEndianStreamImpl) ReadUint16 ¶
func (impl *LittleEndianStreamImpl) ReadUint16() (b uint16, err error)
func (*LittleEndianStreamImpl) ReadUint32 ¶
func (impl *LittleEndianStreamImpl) ReadUint32() (b uint32, err error)
func (*LittleEndianStreamImpl) ReadUint64 ¶
func (impl *LittleEndianStreamImpl) ReadUint64() (b uint64, err error)
func (*LittleEndianStreamImpl) Reset ¶
func (impl *LittleEndianStreamImpl) Reset(buff []byte)
func (*LittleEndianStreamImpl) Size ¶
func (impl *LittleEndianStreamImpl) Size() int
func (*LittleEndianStreamImpl) WriteBuff ¶
func (impl *LittleEndianStreamImpl) WriteBuff(buff []byte) error
func (*LittleEndianStreamImpl) WriteByte ¶
func (impl *LittleEndianStreamImpl) WriteByte(b byte) error
func (*LittleEndianStreamImpl) WriteUint16 ¶
func (impl *LittleEndianStreamImpl) WriteUint16(b uint16) error
func (*LittleEndianStreamImpl) WriteUint32 ¶
func (impl *LittleEndianStreamImpl) WriteUint32(b uint32) error
func (*LittleEndianStreamImpl) WriteUint64 ¶
func (impl *LittleEndianStreamImpl) WriteUint64(b uint64) error
Click to show internal directories.
Click to hide internal directories.