Documentation
¶
Index ¶
- type Reader
- func (r *Reader) Offset() int64
- func (r *Reader) Read(p []byte) (n int, err error)
- func (r *Reader) ReadBinary(v encoding.BinaryUnmarshaler) error
- func (r *Reader) ReadBool() (bool, error)
- func (r *Reader) ReadBytes() (out []byte, err error)
- func (r *Reader) ReadFloat32() (out float32, err error)
- func (r *Reader) ReadFloat32s() ([]float32, error)
- func (r *Reader) ReadFloat64() (out float64, err error)
- func (r *Reader) ReadFloat64s() ([]float64, error)
- func (r *Reader) ReadInt() (int, error)
- func (r *Reader) ReadInt16() (out int16, err error)
- func (r *Reader) ReadInt16s() ([]int16, error)
- func (r *Reader) ReadInt32() (out int32, err error)
- func (r *Reader) ReadInt32s() ([]int32, error)
- func (r *Reader) ReadInt64() (out int64, err error)
- func (r *Reader) ReadInt64s() ([]int64, error)
- func (r *Reader) ReadInt8() (int8, error)
- func (r *Reader) ReadInt8s() ([]int8, error)
- func (r *Reader) ReadInts() ([]int, error)
- func (r *Reader) ReadRange(fn func(i int, r *Reader) error) error
- func (r *Reader) ReadSelf(v io.ReaderFrom) error
- func (r *Reader) ReadString() (out string, err error)
- func (r *Reader) ReadStrings() ([]string, error)
- func (r *Reader) ReadText(v encoding.TextUnmarshaler) error
- func (r *Reader) ReadUint() (uint, error)
- func (r *Reader) ReadUint16() (out uint16, err error)
- func (r *Reader) ReadUint16s() ([]uint16, error)
- func (r *Reader) ReadUint32() (out uint32, err error)
- func (r *Reader) ReadUint32s() ([]uint32, error)
- func (r *Reader) ReadUint64() (out uint64, err error)
- func (r *Reader) ReadUint64s() ([]uint64, error)
- func (r *Reader) ReadUint8() (out uint8, err error)
- func (r *Reader) ReadUint8s() ([]uint8, error)
- func (r *Reader) ReadUints() ([]uint, error)
- func (r *Reader) ReadUvarint() (uint64, error)
- func (r *Reader) ReadVarint() (int64, error)
- type Writer
- func (w *Writer) Close() error
- func (w *Writer) Flush() error
- func (w *Writer) Offset() int64
- func (w *Writer) Reset(out io.Writer)
- func (w *Writer) Write(p []byte) (int, error)
- func (w *Writer) WriteBinary(v encoding.BinaryMarshaler) error
- func (w *Writer) WriteBool(v bool) error
- func (w *Writer) WriteBytes(v []byte) error
- func (w *Writer) WriteFloat32(v float32) error
- func (w *Writer) WriteFloat32s(v []float32) error
- func (w *Writer) WriteFloat64(v float64) error
- func (w *Writer) WriteFloat64s(v []float64) error
- func (w *Writer) WriteInt(v int) error
- func (w *Writer) WriteInt16(v int16) error
- func (w *Writer) WriteInt16s(v []int16) error
- func (w *Writer) WriteInt32(v int32) error
- func (w *Writer) WriteInt32s(v []int32) error
- func (w *Writer) WriteInt64(v int64) error
- func (w *Writer) WriteInt64s(v []int64) error
- func (w *Writer) WriteInt8(v int8) error
- func (w *Writer) WriteInt8s(v []int8) error
- func (w *Writer) WriteInts(v []int) error
- func (w *Writer) WriteRange(length int, fn func(i int, w *Writer) error) error
- func (w *Writer) WriteSelf(v io.WriterTo) error
- func (w *Writer) WriteString(v string) error
- func (w *Writer) WriteStrings(v []string) error
- func (w *Writer) WriteText(v encoding.TextMarshaler) error
- func (w *Writer) WriteUint(v uint) error
- func (w *Writer) WriteUint16(v uint16) error
- func (w *Writer) WriteUint16s(v []uint16) error
- func (w *Writer) WriteUint32(v uint32) error
- func (w *Writer) WriteUint32s(v []uint32) error
- func (w *Writer) WriteUint64(v uint64) error
- func (w *Writer) WriteUint64s(v []uint64) error
- func (w *Writer) WriteUint8(v uint8) error
- func (w *Writer) WriteUint8s(v []uint8) error
- func (w *Writer) WriteUints(v []uint) error
- func (w *Writer) WriteUvarint(x uint64) error
- func (w *Writer) WriteVarint(v int64) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Reader ¶
type Reader struct {
// contains filtered or unexported fields
}
Reader represents a stream reader.
func (*Reader) Offset ¶ added in v1.1.0
Offset returns the number of bytes read through this reader.
func (*Reader) Read ¶ added in v1.0.1
Read implements io.Reader interface by simply calling the Read method on the underlying stream.
func (*Reader) ReadBinary ¶
func (r *Reader) ReadBinary(v encoding.BinaryUnmarshaler) error
ReadBinary reads the bytes from the stream and unmarshals it into the destination interface using UnmarshalBinary() function.
func (*Reader) ReadFloat32 ¶
ReadFloat32 reads a float32
func (*Reader) ReadFloat32s ¶ added in v1.4.0
ReadFloat32s reads an array of float32s
func (*Reader) ReadFloat64 ¶
ReadFloat64 reads a float64
func (*Reader) ReadFloat64s ¶ added in v1.4.0
ReadFloat64s reads an array of float64s
func (*Reader) ReadInt16s ¶ added in v1.4.0
ReadInt16s reads an array of int16s
func (*Reader) ReadInt32s ¶ added in v1.4.0
ReadInt32s reads an array of int32s
func (*Reader) ReadInt64s ¶ added in v1.4.0
ReadInt64s reads an array of int64s
func (*Reader) ReadRange ¶ added in v1.2.1
ReadRange reads the length of the array from the underlying stream and calls a callback function on each element of that array.
func (*Reader) ReadSelf ¶ added in v1.2.0
func (r *Reader) ReadSelf(v io.ReaderFrom) error
ReadSelf uses the provider io.ReaderFrom in order to read the data from the source reader.
func (*Reader) ReadString ¶
ReadString a string prefixed with a variable-size integer size.
func (*Reader) ReadStrings ¶ added in v1.4.0
ReadStrings reads an array of strings
func (*Reader) ReadText ¶
func (r *Reader) ReadText(v encoding.TextUnmarshaler) error
ReadText reads the bytes from the stream and unmarshals it into the destination interface using UnmarshalText() function.
func (*Reader) ReadUint16 ¶
ReadUint16 reads a uint16
func (*Reader) ReadUint16s ¶ added in v1.4.0
ReadUint16s reads an array of uint16s
func (*Reader) ReadUint32 ¶
ReadUint32 reads a uint32
func (*Reader) ReadUint32s ¶ added in v1.4.0
ReadUint32s reads an array of uint32s
func (*Reader) ReadUint64 ¶
ReadUint64 reads a uint64
func (*Reader) ReadUint64s ¶ added in v1.4.0
ReadUint64s reads an array of uint64s
func (*Reader) ReadUint8s ¶ added in v1.4.0
ReadUint8s reads an array of uint8s
func (*Reader) ReadUvarint ¶
ReadUvarint reads a variable-length Uint64 from the buffer.
func (*Reader) ReadVarint ¶
ReadVarint reads a variable-length Int64 from the buffer.
type Writer ¶
type Writer struct {
// contains filtered or unexported fields
}
Writer represents a stream writer.
func (*Writer) Close ¶ added in v1.2.0
Close closes the writer's underlying stream and return its error. If the underlying io.Writer is not an io.Closer, it's a no-op.
func (*Writer) Flush ¶ added in v1.3.0
Flush flushes the writer to the underlying stream and returns its error. If the underlying io.Writer does not have a Flush() error method, it's a no-op.
func (*Writer) Offset ¶ added in v1.1.0
Offset returns the number of bytes written through this writer.
func (*Writer) Write ¶
Write implements io.Writer interface by simply writing into the underlying souurce.
func (*Writer) WriteBinary ¶
func (w *Writer) WriteBinary(v encoding.BinaryMarshaler) error
WriteBinary marshals the type to its binary representation and writes it downstream, prefixed with its size as a variable-size integer.
func (*Writer) WriteBytes ¶
WriteBytes writes a byte slice prefixed with a variable-size integer.
func (*Writer) WriteFloat32 ¶
WriteFloat32 a 32-bit floating point number
func (*Writer) WriteFloat32s ¶ added in v1.4.0
WriteFloat32s writes an array of float32s
func (*Writer) WriteFloat64 ¶
WriteFloat64 a 64-bit floating point number
func (*Writer) WriteFloat64s ¶ added in v1.4.0
WriteFloat64s writes an array of float64s
func (*Writer) WriteInt16s ¶ added in v1.4.0
WriteInt16s writes an array of int16s
func (*Writer) WriteInt32s ¶ added in v1.4.0
WriteInt32s writes an array of int32s
func (*Writer) WriteInt64s ¶ added in v1.4.0
WriteInt64s writes an array of int64s
func (*Writer) WriteInt8s ¶ added in v1.4.0
WriteInt8s writes an array of int8s
func (*Writer) WriteRange ¶ added in v1.2.1
WriteRange writes a specified length of an array and for each element of that array calls the callback function with its index.
func (*Writer) WriteSelf ¶ added in v1.2.0
WriteSelf uses the provider io.WriterTo in order to write the data into the destination writer.
func (*Writer) WriteString ¶
WriteString writes a string prefixed with a variable-size integer.
func (*Writer) WriteStrings ¶ added in v1.4.0
WriteStrings writes an array of strings
func (*Writer) WriteText ¶
func (w *Writer) WriteText(v encoding.TextMarshaler) error
WriteText marshals the type to its text representation and writes it downstream, prefixed with its size as a variable-size integer.
func (*Writer) WriteUint16 ¶
WriteUint16 writes a Uint16
func (*Writer) WriteUint16s ¶ added in v1.4.0
WriteUint16s writes an array of uint16s
func (*Writer) WriteUint32 ¶
WriteUint32 writes a Uint32
func (*Writer) WriteUint32s ¶ added in v1.4.0
WriteUint32s writes an array of uint32s
func (*Writer) WriteUint64 ¶
WriteUint64 writes a Uint64
func (*Writer) WriteUint64s ¶ added in v1.4.0
WriteUint64s writes an array of uint64s
func (*Writer) WriteUint8s ¶ added in v1.4.0
WriteUint8s writes an array of uint8s
func (*Writer) WriteUints ¶ added in v1.4.0
WriteUints writes an array of uints
func (*Writer) WriteUvarint ¶
WriteUvarint writes a variable size unsigned integer
func (*Writer) WriteVarint ¶
WriteVarint writes a variable size signed integer