Documentation ¶
Index ¶
- Variables
- type BufferX
- func (b *BufferX) Bytes() []byte
- func (b *BufferX) Len() int
- func (b *BufferX) ReWrite(pos int, p []byte)
- func (b *BufferX) ReWriteU32(pos int, v uint32)
- func (b *BufferX) Read(p []byte) error
- func (b *BufferX) ReadBool() (bool, error)
- func (b *BufferX) ReadF64() (float64, error)
- func (b *BufferX) ReadI16() (int16, error)
- func (b *BufferX) ReadI32() (int32, error)
- func (b *BufferX) ReadI64() (int64, error)
- func (b *BufferX) ReadLimitString(limit uint32) (string, error)
- func (b *BufferX) ReadN(n int) ([]byte, error)
- func (b *BufferX) ReadString() (string, error)
- func (b *BufferX) ReadU16() (uint16, error)
- func (b *BufferX) ReadU32() (uint32, error)
- func (b *BufferX) ReadU64() (uint64, error)
- func (b *BufferX) ReadU8() (byte, error)
- func (b *BufferX) ReadVarI32() (int32, error)
- func (b *BufferX) ReadVarI64() (int64, error)
- func (b *BufferX) ReadVarU32() (uint32, error)
- func (b *BufferX) ReadVarU64() (uint64, error)
- func (b *BufferX) Reset()
- func (b *BufferX) Write(p []byte)
- func (b *BufferX) WriteBool(v bool)
- func (b *BufferX) WriteF64(v float64)
- func (b *BufferX) WriteI16(v int16)
- func (b *BufferX) WriteI32(v int32)
- func (b *BufferX) WriteI64(v int64)
- func (b *BufferX) WriteLimitString(limit uint32, val string) error
- func (b *BufferX) WriteString(val string)
- func (b *BufferX) WriteU16(v uint16)
- func (b *BufferX) WriteU32(v uint32)
- func (b *BufferX) WriteU64(v uint64)
- func (b *BufferX) WriteU8(v byte)
- func (b *BufferX) WriteVarI32(v int32)
- func (b *BufferX) WriteVarI64(v int64)
- func (b *BufferX) WriteVarU32(v uint32)
- func (b *BufferX) WriteVarU64(v uint64)
- func (b *BufferX) ZReadN(n int) ([]byte, error)
- type IBufferX
- type IReaderX
- type ReaderX
- func (b *ReaderX) Read(p []byte) error
- func (b *ReaderX) ReadBool() (bool, error)
- func (b *ReaderX) ReadByte() (byte, error)
- func (b *ReaderX) ReadF64() (float64, error)
- func (b *ReaderX) ReadI16() (int16, error)
- func (b *ReaderX) ReadI32() (int32, error)
- func (b *ReaderX) ReadI64() (int64, error)
- func (b *ReaderX) ReadLimitString(limit uint32) (string, error)
- func (b *ReaderX) ReadN(n int) ([]byte, error)
- func (b *ReaderX) ReadString() (string, error)
- func (b *ReaderX) ReadU16() (uint16, error)
- func (b *ReaderX) ReadU32() (uint32, error)
- func (b *ReaderX) ReadU64() (uint64, error)
- func (b *ReaderX) ZReadN(n int) ([]byte, error)
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type BufferX ¶
type BufferX struct {
// contains filtered or unexported fields
}
BufferX buffer implement
func NewReadableBufferX ¶
NewReadableBufferX new buffer from existed bytes to read. Use existed bytes to fill buffer, the buffer is always used as read stream.
func NewSizedBufferX ¶
NewSizedBufferX : new buffer with specific size
func (*BufferX) ReWriteU32 ¶
ReWriteU32 rewrite uint32
func (*BufferX) ReadLimitString ¶
ReadLimitString read limit size string
func (*BufferX) ReadVarI32 ¶
ReadVarI32 read variant int32
func (*BufferX) ReadVarI64 ¶
ReadVarI64 read variant int64
func (*BufferX) ReadVarU32 ¶
ReadVarU32 read variant uint32
func (*BufferX) ReadVarU64 ¶
ReadVarU64 read variant uint64
func (*BufferX) WriteLimitString ¶
WriteLimitString write limit size string
func (*BufferX) WriteVarI32 ¶
WriteVarI32 write variant int32
func (*BufferX) WriteVarI64 ¶
WriteVarI64 write variant int64
func (*BufferX) WriteVarU32 ¶
WriteVarU32 write variant uint32
func (*BufferX) WriteVarU64 ¶
WriteVarU64 write variant uint64
type IBufferX ¶
type IBufferX interface { //Len : length Len() int //Read specific p, if length is not enough, return error Read(p []byte) error //ReadN n bytes, if length is not enough, return error ReadN(n int) ([]byte, error) //Write to buffer Write(p []byte) //Bytes left bytes Bytes() []byte //Reset reset cursor Reset() //ReWrite a buffer ReWrite(pos int, p []byte) //ReWriteU32 rewrite with a specific pos ReWriteU32(pos int, v uint32) //ReadU8 read byte ReadU8() (byte, error) //WriteU8 write byte WriteU8(byte) //ReadBool read bool ReadBool() (bool, error) //WriteBool write bool WriteBool(bool) //ReadLimitString read string ReadLimitString(limit uint32) (string, error) //WriteLimitString write string WriteLimitString(limit uint32, val string) error //ReadString read string ReadString() (string, error) //WriteString write string WriteString(val string) //ReadU16 read uint16 ReadU16() (uint16, error) //WriteU16 write uint16 WriteU16(uint16) //ReadI16 read int16 ReadI16() (int16, error) //WriteI16 write int16 WriteI16(int16) //ReadU32 read uint32 ReadU32() (uint32, error) //WriteU32 write uint32 WriteU32(uint32) //ReadI32 read int32 ReadI32() (int32, error) //WriteI32 write int32 WriteI32(int32) //ReadU64 read uint64 ReadU64() (uint64, error) //WriteU64 write uint64 WriteU64(uint64) //ReadI64 read int64 ReadI64() (int64, error) //WriteI64 write int64 WriteI64(int64) //ReadF64 read float64 ReadF64() (float64, error) //WriteF64 write float64 WriteF64(float64) }
IBufferX buffer interface
type IReaderX ¶
type IReaderX interface { //Read : read specific p, if length is not enough, return error Read(p []byte) error //ReadN : read n bytes, if length is not enough, return error ReadN(n int) ([]byte, error) ZReadN(n int) ([]byte, error) //ReadByte : read byte ReadByte() (byte, error) //ReadBool : read bool ReadBool() (bool, error) //ReadLimitString : read string ReadLimitString(limit uint32) (string, error) //ReadString : read string ReadString() (string, error) //ReadU16 : read uint16 ReadU16() (uint16, error) //ReadI16 : read int16 ReadI16() (int16, error) //ReadU32 : read uint32 ReadU32() (uint32, error) //ReadI32 : read int32 ReadI32() (int32, error) //ReadU64 : read uint64 ReadU64() (uint64, error) //ReadI64 : read int64 ReadI64() (int64, error) //ReadF64 : read float64 ReadF64() (float64, error) }
IReaderX reader interface
type ReaderX ¶
type ReaderX struct {
// contains filtered or unexported fields
}
ReaderX buffer implement
func (*ReaderX) ReadLimitString ¶
ReadLimitString read limit size string