codec

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IntToByteBigEndian

func IntToByteBigEndian(i int) []byte

func ReadBytes

func ReadBytes(reader io.Reader, size int) ([]byte, error)

func ReadInt

func ReadInt(reader io.Reader) (int, error)

Types

type ByteBuf

type ByteBuf struct {
	*bufio.Reader
	*bufio.Writer
}

func NewReadByteBuf

func NewReadByteBuf(reader *bufio.Reader) *ByteBuf

func NewReadWriteByteBuf

func NewReadWriteByteBuf(reader *bufio.Reader, writer *bufio.Writer) *ByteBuf

func NewWriteByteBuf

func NewWriteByteBuf(writeBuffer *bufio.Writer) *ByteBuf

func (*ByteBuf) Flush

func (b *ByteBuf) Flush()

func (*ByteBuf) ReadBuffer

func (b *ByteBuf) ReadBuffer() *bufio.Reader

func (*ByteBuf) ReadBytea

func (b *ByteBuf) ReadBytea() byte

func (*ByteBuf) ReadBytes

func (b *ByteBuf) ReadBytes(size int) []byte

func (*ByteBuf) ReadInt

func (b *ByteBuf) ReadInt() int

func (*ByteBuf) ReadLine

func (b *ByteBuf) ReadLine() string

func (*ByteBuf) WriteBuffer

func (b *ByteBuf) WriteBuffer() *bufio.Writer

func (*ByteBuf) WriteBytea

func (b *ByteBuf) WriteBytea(data byte)

func (*ByteBuf) WriteBytes

func (b *ByteBuf) WriteBytes(data []byte)

func (*ByteBuf) WriteInt

func (b *ByteBuf) WriteInt(data int)

func (*ByteBuf) WriteString

func (b *ByteBuf) WriteString(data string)

type LengthBased

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

LengthBased 长度解码器, 重试从缓冲区解析数据帧程度

func NewLengthBased

func NewLengthBased(lengthFieldOffset int, lengthFieldLength int, lengthAdjustment int, initialBytesToStrip int) *LengthBased

func (*LengthBased) Decode

func (l *LengthBased) Decode(reader *bufio.Reader) (*bufio.Reader, error)

Decode 长度解码器

Jump to

Keyboard shortcuts

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