Documentation ¶
Index ¶
- Variables
- func Address(v []byte) common.Address
- func Amount(v []byte) *amount.Amount
- func FillBytes(r io.Reader, bs []byte) (int64, error)
- func MustWriterToHash(w io.WriterTo) hash.Hash256
- func PutUint16(bs []byte, v uint16)
- func PutUint32(bs []byte, v uint32)
- func PutUint64(bs []byte, v uint64)
- func ReadBool(r io.Reader) (bool, int64, error)
- func ReadBytes(r io.Reader) ([]byte, int64, error)
- func ReadFromBytes(r io.ReaderFrom, bs []byte) (int64, error)
- func ReadString(r io.Reader) (string, int64, error)
- func ReadUint16(r io.Reader) (uint16, int64, error)
- func ReadUint32(r io.Reader) (uint32, int64, error)
- func ReadUint64(r io.Reader) (uint64, int64, error)
- func ReadUint8(r io.Reader) (uint8, int64, error)
- func TypeReadAll(bs []byte, count int) ([]interface{}, error)
- func TypeWriteAll(vs ...interface{}) []byte
- func Uint16(v []byte) uint16
- func Uint16Bytes(v uint16) []byte
- func Uint32(v []byte) uint32
- func Uint32Bytes(v uint32) []byte
- func Uint64(v []byte) uint64
- func Uint64Bytes(v uint64) []byte
- func WriteBool(w io.Writer, b bool) (int64, error)
- func WriteBytes(w io.Writer, bs []byte) (int64, error)
- func WriteString(w io.Writer, str string) (int64, error)
- func WriteUint16(w io.Writer, num uint16) (int64, error)
- func WriteUint32(w io.Writer, num uint32) (int64, error)
- func WriteUint64(w io.Writer, num uint64) (int64, error)
- func WriteUint8(w io.Writer, num uint8) (int64, error)
- func WriterToBytes(w io.WriterTo) ([]byte, int64, error)
- func WriterToHash(w io.WriterTo) (hash.Hash256, int64, error)
- type SumReader
- func (sr *SumReader) Address(r io.Reader, p *common.Address) (int64, error)
- func (sr *SumReader) Amount(r io.Reader, p **amount.Amount) (int64, error)
- func (sr *SumReader) BigInt(r io.Reader, p **big.Int) (int64, error)
- func (sr *SumReader) Bool(r io.Reader, p *bool) (int64, error)
- func (sr *SumReader) Bytes(r io.Reader, p *[]byte) (int64, error)
- func (sr *SumReader) ChainIDVersion(r io.Reader, chainID **big.Int, version *uint16) (int64, error)
- func (sr *SumReader) GetUint16(r io.Reader) (uint16, int64, error)
- func (sr *SumReader) GetUint32(r io.Reader) (uint32, int64, error)
- func (sr *SumReader) GetUint64(r io.Reader) (uint64, int64, error)
- func (sr *SumReader) GetUint8(r io.Reader) (uint8, int64, error)
- func (sr *SumReader) Hash256(r io.Reader, p *hash.Hash256) (int64, error)
- func (sr *SumReader) PublicKey(r io.Reader, p *common.PublicKey) (int64, error)
- func (sr *SumReader) ReaderFrom(r io.Reader, p io.ReaderFrom) (int64, error)
- func (sr *SumReader) Signature(r io.Reader, p *common.Signature) (int64, error)
- func (sr *SumReader) String(r io.Reader, p *string) (int64, error)
- func (sr *SumReader) Sum() int64
- func (sr *SumReader) Uint16(r io.Reader, p *uint16) (int64, error)
- func (sr *SumReader) Uint32(r io.Reader, p *uint32) (int64, error)
- func (sr *SumReader) Uint64(r io.Reader, p *uint64) (int64, error)
- func (sr *SumReader) Uint8(r io.Reader, p *uint8) (int64, error)
- type SumWriter
- func (sw *SumWriter) Address(w io.Writer, v common.Address) (int64, error)
- func (sw *SumWriter) Amount(w io.Writer, v *amount.Amount) (int64, error)
- func (sw *SumWriter) BigInt(w io.Writer, v *big.Int) (int64, error)
- func (sw *SumWriter) Bool(w io.Writer, v bool) (int64, error)
- func (sw *SumWriter) Bytes(w io.Writer, v []byte) (int64, error)
- func (sw *SumWriter) ChainIDVersion(w io.Writer, chainID *big.Int, version uint16) (int64, error)
- func (sw *SumWriter) Hash256(w io.Writer, v hash.Hash256) (int64, error)
- func (sw *SumWriter) PublicKey(w io.Writer, v common.PublicKey) (int64, error)
- func (sw *SumWriter) Signature(w io.Writer, v common.Signature) (int64, error)
- func (sw *SumWriter) String(w io.Writer, v string) (int64, error)
- func (sw *SumWriter) Sum() int64
- func (sw *SumWriter) Uint16(w io.Writer, v uint16) (int64, error)
- func (sw *SumWriter) Uint32(w io.Writer, v uint32) (int64, error)
- func (sw *SumWriter) Uint64(w io.Writer, v uint64) (int64, error)
- func (sw *SumWriter) Uint8(w io.Writer, v uint8) (int64, error)
- func (sw *SumWriter) WriterTo(w io.Writer, v io.WriterTo) (int64, error)
- type TypeReader
- type TypeWriter
Constants ¶
This section is empty.
Variables ¶
var (
ErrInvalidLength = errors.New("invalid length")
)
util errors
Functions ¶
func MustWriterToHash ¶
MustWriterToHash return bytes from writer to
func ReadFromBytes ¶
func ReadFromBytes(r io.ReaderFrom, bs []byte) (int64, error)
ReadFromBytes return bytes from writer to
func ReadString ¶
ReadString reads a string array from the reader
func ReadUint16 ¶
ReadUint16 reads a uint16 number from the reader
func ReadUint32 ¶
ReadUint32 reads a uint32 number from the reader
func ReadUint64 ¶
ReadUint64 reads a uint64 number from the reader
func TypeReadAll ¶
func TypeWriteAll ¶
func TypeWriteAll(vs ...interface{}) []byte
func Uint16Bytes ¶
Uint16Bytes returns a byte array of the uint16 number
func Uint32Bytes ¶
Uint32Bytes returns a byte array of the uint32 number
func Uint64Bytes ¶
Uint64Bytes returns a byte array of the uint64 number
func WriteBytes ¶
WriteBytes writes the byte array bytes with the var-length-bytes to the writer
func WriteString ¶
WriteString writes the string with the var-length-byte to the writer
func WriteUint16 ¶
WriteUint16 writes the uint16 number to the writer
func WriteUint32 ¶
WriteUint32 writes the uint32 number to the writer
func WriteUint64 ¶
WriteUint64 writes the uint64 number to the writer
func WriteUint8 ¶
WriteUint8 writes the uint8 number to the writer
func WriterToBytes ¶
WriterToBytes return bytes from writer to
Types ¶
type SumReader ¶
type SumReader struct {
// contains filtered or unexported fields
}
func NewSumReader ¶
func NewSumReader() *SumReader
func (*SumReader) ChainIDVersion ¶
func (*SumReader) ReaderFrom ¶
type SumWriter ¶
type SumWriter struct {
// contains filtered or unexported fields
}
func NewSumWriter ¶
func NewSumWriter() *SumWriter
func (*SumWriter) ChainIDVersion ¶
type TypeReader ¶
type TypeReader struct {
// contains filtered or unexported fields
}
func (*TypeReader) Sum ¶
func (tr *TypeReader) Sum() int64
type TypeWriter ¶
type TypeWriter struct {
// contains filtered or unexported fields
}
func NewTypeWriter ¶
func NewTypeWriter() *TypeWriter
func (*TypeWriter) Sum ¶
func (tw *TypeWriter) Sum() int64