Documentation ¶
Overview ¶
Package bintly defines binary coding and encoding using native golang numeric data type representation.
Index ¶
- Constants
- func Decode(data []byte, coder Decoder) error
- func Encode(coder Encoder) ([]byte, error)
- func Float32(b []byte) float32
- func Float64(b []byte) float64
- func GetFloat32s(bs []byte, vs []float32)
- func GetFloat64s(bs []byte, vs []float64)
- func GetInt(b []byte, v *int)
- func GetInt16(b []byte, v *int16)
- func GetInt16s(bs []byte, vs []int16)
- func GetInt32(b []byte, v *int32)
- func GetInt32s(bs []byte, vs []int32)
- func GetInt64(b []byte, v *int64)
- func GetInt64s(bs []byte, vs []int64)
- func GetInt8s(bs []byte, vs []int8)
- func GetInts(bs []byte, vs []int)
- func GetUint(b []byte, v *uint)
- func GetUint16(b []byte, v *uint16)
- func GetUint16s(bs []byte, vs []uint16)
- func GetUint32(b []byte, v *uint32)
- func GetUint32s(bs []byte, vs []uint32)
- func GetUint64(b []byte, v *uint64)
- func GetUint64s(bs []byte, vs []uint64)
- func GetUint8s(bs []byte, vs []uint8)
- func GetUints(bs []byte, vs []uint)
- func Int(b []byte) int
- func Int16(b []byte) int16
- func Int16s(bs []byte) []int16
- func Int32(b []byte) int32
- func Int32s(bs []byte) []int32
- func Int64(b []byte) int64
- func Int64s(bs []byte) []int64
- func Int8s(bs []byte) []int8
- func Ints(bs []byte) []int
- func Marshal(v interface{}) ([]byte, error)
- func MarshalStream(stream *Writer, v interface{}) ([]byte, error)
- func PutFloat32(dest []byte, v float32)
- func PutFloat32s(bs []byte, vs []float32)
- func PutFloat64(dest []byte, v float64)
- func PutFloat64s(bs []byte, vs []float64)
- func PutInt(dest []byte, v int)
- func PutInt16(dest []byte, v int16)
- func PutInt16s(bs []byte, vs []int16)
- func PutInt32(dest []byte, v int32)
- func PutInt32s(bs []byte, vs []int32)
- func PutInt64(dest []byte, v int64)
- func PutInt64s(bs []byte, vs []int64)
- func PutInt8s(bs []byte, vs []int8)
- func PutInts(bs []byte, vs []int)
- func PutUint(dest []byte, v uint)
- func PutUint16(dest []byte, v uint16)
- func PutUint16s(bs []byte, vs []uint16)
- func PutUint32(dest []byte, v uint32)
- func PutUint32s(bs []byte, vs []uint32)
- func PutUint64(dest []byte, v uint64)
- func PutUint64s(bs []byte, vs []uint64)
- func PutUint8s(bs []byte, vs []uint8)
- func PutUints(bs []byte, vs []uint)
- func Uint(b []byte) uint
- func Uint16(b []byte) uint16
- func Uint16s(bs []byte) []uint16
- func Uint32(b []byte) uint32
- func Uint32s(bs []byte) []uint32
- func Uint64(b []byte) uint64
- func Uint64s(bs []byte) []uint64
- func Uint8s(bs []byte) []uint8
- func Unmarshal(data []byte, v interface{}) error
- func UnmarshalStream(stream *Reader, data []byte, v interface{}) error
- type Alloc
- type Allocator
- type Decoder
- type Encoder
- type Reader
- func (r *Reader) Alloc() int32
- func (r *Reader) Any(v interface{}) error
- func (r *Reader) Bool(v *bool)
- func (r *Reader) BoolPtr(v **bool)
- func (r *Reader) Bools(vs *[]bool)
- func (r *Reader) Coder(coder Decoder) error
- func (r *Reader) Float32(v *float32)
- func (r *Reader) Float32Ptr(v **float32)
- func (r *Reader) Float32s(vs *[]float32)
- func (r *Reader) Float64(v *float64)
- func (r *Reader) Float64Ptr(v **float64)
- func (r *Reader) Float64s(vs *[]float64)
- func (r *Reader) FromBytes(data []byte) error
- func (r *Reader) Int(v *int)
- func (r *Reader) Int16(v *int16)
- func (r *Reader) Int16Ptr(v **int16)
- func (r *Reader) Int16s(vs *[]int16)
- func (r *Reader) Int32(v *int32)
- func (r *Reader) Int32Ptr(v **int32)
- func (r *Reader) Int32s(vs *[]int32)
- func (r *Reader) Int64(v *int64)
- func (r *Reader) Int64Ptr(v **int64)
- func (r *Reader) Int64s(vs *[]int64)
- func (r *Reader) Int8(v *int8)
- func (r *Reader) Int8Ptr(v **int8)
- func (r *Reader) Int8s(vs *[]int8)
- func (r *Reader) IntPtr(v **int)
- func (r *Reader) Ints(vs *[]int)
- func (r *Reader) MAlloc() uint16
- func (r *Reader) MInt32s(vs *[]int32)
- func (r *Reader) MInt64s(vs *[]int64)
- func (r *Reader) MInts(vs *[]int)
- func (r *Reader) MString(v *string)
- func (r *Reader) MStringPtr(v **string)
- func (r *Reader) MStrings(v *[]string)
- func (r *Reader) MUint32s(vs *[]uint32)
- func (r *Reader) MUint64s(vs *[]uint64)
- func (r *Reader) MUint8s(vs *[]uint8)
- func (r *Reader) MUints(vs *[]uint)
- func (r *Reader) String(v *string)
- func (r *Reader) StringPtr(v **string)
- func (r *Reader) Strings(v *[]string)
- func (r *Reader) Time(v *time.Time)
- func (r *Reader) TimePtr(v **time.Time)
- func (r *Reader) Uint(v *uint)
- func (r *Reader) Uint16(v *uint16)
- func (r *Reader) Uint16Ptr(v **uint16)
- func (r *Reader) Uint16s(vs *[]uint16)
- func (r *Reader) Uint32(v *uint32)
- func (r *Reader) Uint32Ptr(v **uint32)
- func (r *Reader) Uint32s(vs *[]uint32)
- func (r *Reader) Uint64(v *uint64)
- func (r *Reader) Uint64Ptr(v **uint64)
- func (r *Reader) Uint64s(vs *[]uint64)
- func (r *Reader) Uint8(v *uint8)
- func (r *Reader) Uint8Ptr(v **uint8)
- func (r *Reader) Uint8s(vs *[]uint8)
- func (r *Reader) UintPtr(v **uint)
- func (r *Reader) Uints(vs *[]uint)
- type Readers
- type Writer
- func (w *Writer) Alloc(size int32)
- func (w *Writer) Any(v interface{}) error
- func (w *Writer) Bool(v bool)
- func (w *Writer) BoolPtr(v *bool)
- func (w *Writer) Bools(vs []bool)
- func (w *Writer) Bytes() []byte
- func (w *Writer) Coder(v Encoder) error
- func (s *Writer) Float32(v float32)
- func (w *Writer) Float32Ptr(v *float32)
- func (w *Writer) Float32s(vs []float32)
- func (s *Writer) Float64(v float64)
- func (w *Writer) Float64Ptr(v *float64)
- func (w *Writer) Float64s(vs []float64)
- func (s *Writer) Int(v int)
- func (s *Writer) Int16(v int16)
- func (w *Writer) Int16Ptr(v *int16)
- func (w *Writer) Int16s(vs []int16)
- func (s *Writer) Int32(v int32)
- func (w *Writer) Int32Ptr(v *int32)
- func (w *Writer) Int32s(vs []int32)
- func (s *Writer) Int64(v int64)
- func (w *Writer) Int64Ptr(v *int64)
- func (w *Writer) Int64s(vs []int64)
- func (s *Writer) Int8(v int8)
- func (w *Writer) Int8Ptr(v *int8)
- func (w *Writer) Int8s(vs []int8)
- func (w *Writer) IntPtr(v *int)
- func (w *Writer) Ints(vs []int)
- func (w *Writer) MAlloc(size uint16)
- func (w *Writer) MInt32s(vs []int32)
- func (w *Writer) MInt64s(vs []int64)
- func (w *Writer) MInts(vs []int)
- func (w *Writer) MString(v string)
- func (w *Writer) MStringPtr(v *string)
- func (w *Writer) MStrings(v []string)
- func (w *Writer) MUint32s(vs []uint32)
- func (w *Writer) MUint64s(vs []uint64)
- func (w *Writer) MUint8s(vs []uint8)
- func (w *Writer) MUints(vs []uint)
- func (w *Writer) Size() int
- func (w *Writer) String(v string)
- func (w *Writer) StringPtr(v *string)
- func (w *Writer) Strings(v []string)
- func (w *Writer) Time(v time.Time)
- func (w *Writer) TimePtr(v *time.Time)
- func (s *Writer) Uint(v uint)
- func (s *Writer) Uint16(v uint16)
- func (w *Writer) Uint16Ptr(v *uint16)
- func (w *Writer) Uint16s(vs []uint16)
- func (s *Writer) Uint32(v uint32)
- func (w *Writer) Uint32Ptr(v *uint32)
- func (w *Writer) Uint32s(vs []uint32)
- func (s *Writer) Uint64(v uint64)
- func (w *Writer) Uint64Ptr(v *uint64)
- func (w *Writer) Uint64s(vs []uint64)
- func (s *Writer) Uint8(v uint8)
- func (w *Writer) Uint8Ptr(v *uint8)
- func (w *Writer) Uint8s(vs []uint8)
- func (w *Writer) UintPtr(v *uint)
- func (w *Writer) Uints(vs []uint)
- type Writers
Constants ¶
View Source
const (
//represents nil size
NilSize = -1
)
Variables ¶
This section is empty.
Functions ¶
func MarshalStream ¶
MarshalStream converts e into []byte, or error
func UnmarshalStream ¶
UnmarshalStream converts []byte to e pointer or error
Types ¶
type Alloc ¶
type Alloc interface { //Alloc returns size of repeated type Alloc() int32 }
Alloc represents repeated type allocator
type Allocator ¶
type Allocator interface {
SetAlloc(allocation int32)
}
Allocator represents repeated type allocator
type Encoder ¶
type Encoder interface { //EncodeBinary writes data to the stream EncodeBinary(stream *Writer) error }
Encoder defines an encoder interface
type Reader ¶
type Reader struct {
// contains filtered or unexported fields
}
Reader represents binary readers
func (*Reader) Float32Ptr ¶
Float32Ptr reads into **float32
func (*Reader) Float64Ptr ¶
Float64Ptr reads into **float64
type Writer ¶
type Writer struct {
// contains filtered or unexported fields
}
Writer represents binary writer
Source Files ¶
Click to show internal directories.
Click to hide internal directories.