bytes

package
v0.0.0-...-7c60c3b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 2, 2019 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Buffer

type Buffer struct {
	// contains filtered or unexported fields
}

func NewBuffer

func NewBuffer(b []byte) Buffer

func (*Buffer) Available

func (this *Buffer) Available() int

func (*Buffer) Bit

func (this *Buffer) Bit(n int) byte

func (*Buffer) BitSet

func (this *Buffer) BitSet(n int, b byte)

func (*Buffer) Bytes

func (this *Buffer) Bytes() []byte

func (*Buffer) CapLen

func (this *Buffer) CapLen() int

func (*Buffer) Len

func (this *Buffer) Len() int

func (*Buffer) LenSet

func (this *Buffer) LenSet(n int)

func (*Buffer) Next

func (this *Buffer) Next(n int)

func (*Buffer) Pos

func (this *Buffer) Pos() int

func (*Buffer) Read

func (this *Buffer) Read(b []byte) (n int, err error)

func (*Buffer) Reset

func (this *Buffer) Reset()

func (*Buffer) Seek

func (this *Buffer) Seek(p int)

func (*Buffer) SeekBegin

func (this *Buffer) SeekBegin()

func (*Buffer) SeekEnd

func (this *Buffer) SeekEnd() int

func (*Buffer) SetBuffer

func (this *Buffer) SetBuffer(b []byte)

func (*Buffer) String

func (this *Buffer) String() string

func (*Buffer) Write

func (this *Buffer) Write(b []byte) (n int, err error)

type ByteArray

type ByteArray struct {
	Buffer
	// contains filtered or unexported fields
}

bytes

func (*ByteArray) Endian

func (this *ByteArray) Endian() (endian binary.ByteOrder)

func (*ByteArray) Rbool

func (this *ByteArray) Rbool() bool

read

func (*ByteArray) Rint

func (this *ByteArray) Rint() int

特殊的io(int=int64/int32)

func (*ByteArray) Rint16

func (this *ByteArray) Rint16() int16

func (*ByteArray) Rint32

func (this *ByteArray) Rint32() int32

func (*ByteArray) Rint64

func (this *ByteArray) Rint64() int64

func (*ByteArray) Rint8

func (this *ByteArray) Rint8() int8

func (*ByteArray) Robj

func (this *ByteArray) Robj(v interface{})

read

func (*ByteArray) Rstr

func (this *ByteArray) Rstr() (str string)

func (*ByteArray) Ruint16

func (this *ByteArray) Ruint16() (v uint16)

func (*ByteArray) Ruint32

func (this *ByteArray) Ruint32() (v uint32)

func (*ByteArray) Ruint64

func (this *ByteArray) Ruint64() (v uint64)

func (*ByteArray) Ruint8

func (this *ByteArray) Ruint8() (v uint8)

func (*ByteArray) Wbool

func (this *ByteArray) Wbool(ok bool)

write int

func (*ByteArray) Wint

func (this *ByteArray) Wint(v int)

func (*ByteArray) Wint16

func (this *ByteArray) Wint16(v int16)

func (*ByteArray) Wint32

func (this *ByteArray) Wint32(v int32)

func (*ByteArray) Wint64

func (this *ByteArray) Wint64(v int64)

func (*ByteArray) Wint8

func (this *ByteArray) Wint8(v int8)

func (*ByteArray) Wobj

func (this *ByteArray) Wobj(v interface{})

write

func (*ByteArray) WriteTo

func (this *ByteArray) WriteTo(b io.Writer, n int) int

b会增长

func (*ByteArray) Wstr

func (this *ByteArray) Wstr(str string)

func (*ByteArray) Wuint16

func (this *ByteArray) Wuint16(v uint16)

func (*ByteArray) Wuint32

func (this *ByteArray) Wuint32(v uint32)

func (*ByteArray) Wuint64

func (this *ByteArray) Wuint64(v uint64)

func (*ByteArray) Wuint8

func (this *ByteArray) Wuint8(v uint8)

write uint

type IBuffer

type IBuffer interface {
	IReader
	IWriter
	//pos
	Pos() int
	Seek(int)
	SeekBegin()
	SeekEnd() int
	//len
	Reset()
	Len() int
	LenSet(int)
	CapLen() int
	Available() int
	//bytes
	Bytes() []byte
}

func New

func New() IBuffer

func With

func With(b []byte) IBuffer

func WithSize

func WithSize(n int) IBuffer

type IReader

type IReader interface {
	io.Reader
	Rbool() bool
	Rstr() string
	//int
	Rint() int
	Rint8() int8
	Rint16() int16
	Rint32() int32
	Rint64() int64
	//uint
	//Ruint() uint
	Ruint8() uint8
	Ruint16() uint16
	Ruint32() uint32
	Ruint64() uint64
	//other
	Robj(interface{})
}

type IWriter

type IWriter interface {
	io.Writer
	Wbool(bool)
	Wstr(string)
	//int
	Wint(int)
	Wint8(int8)
	Wint16(int16)
	Wint32(int32)
	Wint64(int64)
	//uint
	//Wuint(uint)
	Wuint8(uint8)
	Wuint16(uint16)
	Wuint32(uint32)
	Wuint64(uint64)
	//other
	Wobj(interface{})
	WriteTo(io.Writer, int) int
}

type ReadObj

type ReadObj interface {
	Read(IReader)
}

i/o object

type WriteObj

type WriteObj interface {
	Write(IWriter)
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL