Documentation ¶
Index ¶
- type Encoder
- func (erw Encoder) Endianness() binary.ByteOrder
- func (erw *Encoder) Err() (err error)
- func (erw *Encoder) Int16() (i int16)
- func (erw *Encoder) Int32() (i int32)
- func (erw *Encoder) Int64() (i int64)
- func (erw *Encoder) Int8() (i int8)
- func (erw *Encoder) LimitRead(n int64)
- func (erw *Encoder) Pad(b byte, cnt int)
- func (erw *Encoder) Read(data []byte) (cnt int, err error)
- func (erw *Encoder) ReadByte() (b byte)
- func (erw *Encoder) ReadString(lenSize int) (data string, size int)
- func (erw *Encoder) ReadStringWithLen(len int) (data string)
- func (erw *Encoder) SetCharset(c encoding.Encoding) error
- func (erw *Encoder) SetEndianness(endianness binary.ByteOrder)
- func (erw *Encoder) Skip(cnt int64)
- func (erw *Encoder) Uint16() (i uint16)
- func (erw *Encoder) Uint32() (i uint32)
- func (erw *Encoder) Uint64() (i uint64)
- func (erw *Encoder) Uint8() (i uint8)
- func (erw *Encoder) UnlimitRead()
- func (erw *Encoder) Write(b []byte) (cnt int, err error)
- func (erw *Encoder) WriteAsciiString(data string) int
- func (erw *Encoder) WriteAsciiStringWithLen(lenSize int, data string)
- func (erw *Encoder) WriteByte(b byte)
- func (erw *Encoder) WriteInt16(i int16)
- func (erw *Encoder) WriteInt32(i int32)
- func (erw *Encoder) WriteInt64(i int64)
- func (erw *Encoder) WriteInt8(i int8)
- func (erw *Encoder) WriteString(data string) int
- func (erw *Encoder) WriteStringWithLen(lenSize int, data string)
- func (erw *Encoder) WriteUint16(i uint16)
- func (erw *Encoder) WriteUint32(i uint32)
- func (erw *Encoder) WriteUint64(i uint64)
- func (erw *Encoder) WriteUint8(i uint8)
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 ¶
Endianness returns the byte order of the Encoder
func (*Encoder) ReadStringWithLen ¶
func (*Encoder) SetCharset ¶
SetCharset changes the charset. Expects the html name of the charset.
func (*Encoder) SetEndianness ¶
SetEndianness changes the endianness
func (*Encoder) UnlimitRead ¶
func (erw *Encoder) UnlimitRead()
UnlimitRead removes the read limitation
func (*Encoder) WriteAsciiString ¶
func (*Encoder) WriteAsciiStringWithLen ¶
func (*Encoder) WriteInt16 ¶
func (*Encoder) WriteInt32 ¶
func (*Encoder) WriteInt64 ¶
func (*Encoder) WriteString ¶
WriteString writes a string to the underlying writer
func (*Encoder) WriteStringWithLen ¶
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.