Documentation ¶
Overview ¶
Package encoding implements hdb field type en,- and decodings.
Index ¶
- type Decoder
- func (d *Decoder) Bool() bool
- func (d *Decoder) Byte() byte
- func (d *Decoder) Bytes(p []byte)
- func (d *Decoder) CESU8Bytes(size int) ([]byte, error)
- func (d *Decoder) Cnt() int
- func (d *Decoder) Decimal() (*big.Int, int, error)
- func (d *Decoder) Dfv() int
- func (d *Decoder) Error() error
- func (d *Decoder) Fixed(size int) *big.Int
- func (d *Decoder) Float32() float32
- func (d *Decoder) Float64() float64
- func (d *Decoder) Int16() int16
- func (d *Decoder) Int32() int32
- func (d *Decoder) Int64() int64
- func (d *Decoder) Int8() int8
- func (d *Decoder) ResetCnt()
- func (d *Decoder) ResetError() error
- func (d *Decoder) SetDfv(dfv int)
- func (d *Decoder) Skip(cnt int)
- func (d *Decoder) Uint16() uint16
- func (d *Decoder) Uint32() uint32
- func (d *Decoder) Uint32ByteOrder(byteOrder binary.ByteOrder) uint32
- func (d *Decoder) Uint64() uint64
- type Encoder
- func (e *Encoder) Bool(v bool)
- func (e *Encoder) Byte(b byte)
- func (e *Encoder) Bytes(p []byte)
- func (e *Encoder) CESU8Bytes(p []byte) int
- func (e *Encoder) CESU8String(s string) int
- func (e *Encoder) Decimal(m *big.Int, exp int)
- func (e *Encoder) Fixed(m *big.Int, size int)
- func (e *Encoder) Float32(f float32)
- func (e *Encoder) Float64(f float64)
- func (e *Encoder) Int16(i int16)
- func (e *Encoder) Int32(i int32)
- func (e *Encoder) Int64(i int64)
- func (e *Encoder) Int8(i int8)
- func (e *Encoder) String(s string)
- func (e *Encoder) Uint16(i uint16)
- func (e *Encoder) Uint32(i uint32)
- func (e *Encoder) Uint64(i uint64)
- func (e *Encoder) Zeroes(cnt int)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Decoder ¶
type Decoder struct {
// contains filtered or unexported fields
}
Decoder decodes hdb protocol datatypes an basis of an io.Reader.
func NewDecoder ¶
func NewDecoder(rd io.Reader, decoder func() transform.Transformer) *Decoder
NewDecoder creates a new Decoder instance based on an io.Reader.
func (*Decoder) CESU8Bytes ¶
CESU8Bytes reads a size CESU-8 encoded byte sequence and returns an UTF-8 byte slice. - error is only returned in case of conversion errors.
func (*Decoder) Decimal ¶
Decimal reads and returns a decimal. - error is only returned in case of conversion errors.
func (*Decoder) ResetError ¶
ResetError return and resets reader error.
func (*Decoder) Uint32ByteOrder ¶
Uint32ByteOrder reads and returns an uint32 in given byte order.
type Encoder ¶
type Encoder struct {
// contains filtered or unexported fields
}
Encoder encodes hdb protocol datatypes an basis of an io.Writer.
func NewEncoder ¶
func NewEncoder(wr io.Writer, encoder func() transform.Transformer) *Encoder
NewEncoder creates a new Encoder instance.
func (*Encoder) CESU8Bytes ¶
CESU8Bytes writes an UTF-8 byte slice as CESU-8 and returns the CESU-8 bytes written.
func (*Encoder) CESU8String ¶
CESU8String is like WriteCesu8 with an UTF-8 string as parameter.