binary

package
v0.1.8 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2021 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Encoder

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

Encoder without charset conversion

func NewEncoder

func NewEncoder(rw io.ReadWriter, endianness binary.ByteOrder) Encoder

NewEncoder returns an Encoder without charset conversion

func NewEncoderCharset

func NewEncoderCharset(rw io.ReadWriter, endianness binary.ByteOrder,
	charset encoding.Encoding) (e Encoder, err error)

NewEncoderCharset returns an Encoder which handles charset conversion

func (Encoder) Endianness

func (erw Encoder) Endianness() binary.ByteOrder

Endianness returns the byte order of the Encoder

func (*Encoder) Err

func (erw *Encoder) Err() (err error)

Err reads the last error from the encoder and resets the error status

func (*Encoder) Int16

func (erw *Encoder) Int16() (i int16)

func (*Encoder) Int32

func (erw *Encoder) Int32() (i int32)

func (*Encoder) Int64

func (erw *Encoder) Int64() (i int64)

func (*Encoder) Int8

func (erw *Encoder) Int8() (i int8)

func (*Encoder) LimitRead

func (erw *Encoder) LimitRead(n int64)

LimitRead limits the read to n bytes

func (*Encoder) Pad

func (erw *Encoder) Pad(b byte, cnt int)

func (*Encoder) Read

func (erw *Encoder) Read(data []byte) (cnt int, err error)

Read implements io.Reader

func (*Encoder) ReadByte

func (erw *Encoder) ReadByte() (b byte)

func (*Encoder) ReadString

func (erw *Encoder) ReadString(lenSize int) (data string, size int)

func (*Encoder) ReadStringWithLen

func (erw *Encoder) ReadStringWithLen(len int) (data string)

func (*Encoder) SetCharset

func (erw *Encoder) SetCharset(c encoding.Encoding) error

SetCharset changes the charset. Expects the html name of the charset.

func (*Encoder) SetEndianness

func (erw *Encoder) SetEndianness(endianness binary.ByteOrder)

SetEndianness changes the endianness

func (*Encoder) Skip

func (erw *Encoder) Skip(cnt int64)

func (*Encoder) Uint16

func (erw *Encoder) Uint16() (i uint16)

func (*Encoder) Uint32

func (erw *Encoder) Uint32() (i uint32)

func (*Encoder) Uint64

func (erw *Encoder) Uint64() (i uint64)

func (*Encoder) Uint8

func (erw *Encoder) Uint8() (i uint8)

func (*Encoder) UnlimitRead

func (erw *Encoder) UnlimitRead()

UnlimitRead removes the read limitation

func (*Encoder) Write

func (erw *Encoder) Write(b []byte) (cnt int, err error)

Write implements io.Writer

func (*Encoder) WriteAsciiString

func (erw *Encoder) WriteAsciiString(data string) int

func (*Encoder) WriteAsciiStringWithLen

func (erw *Encoder) WriteAsciiStringWithLen(lenSize int, data string)

func (*Encoder) WriteByte

func (erw *Encoder) WriteByte(b byte)

func (*Encoder) WriteInt16

func (erw *Encoder) WriteInt16(i int16)

func (*Encoder) WriteInt32

func (erw *Encoder) WriteInt32(i int32)

func (*Encoder) WriteInt64

func (erw *Encoder) WriteInt64(i int64)

func (*Encoder) WriteInt8

func (erw *Encoder) WriteInt8(i int8)

func (*Encoder) WriteString

func (erw *Encoder) WriteString(data string) int

WriteString writes a string to the underlying writer

func (*Encoder) WriteStringWithLen

func (erw *Encoder) WriteStringWithLen(lenSize int, data string)

WriteStringWithLen writes a string along with its lenght. The first parameter gives the size of the length in bytes. When character set encoding is necessary, the length is computed after conversion and properly sent.

func (*Encoder) WriteUint16

func (erw *Encoder) WriteUint16(i uint16)

func (*Encoder) WriteUint32

func (erw *Encoder) WriteUint32(i uint32)

func (*Encoder) WriteUint64

func (erw *Encoder) WriteUint64(i uint64)

func (*Encoder) WriteUint8

func (erw *Encoder) WriteUint8(i uint8)

Jump to

Keyboard shortcuts

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