Documentation ¶
Index ¶
- func GoTo(seeker io.Seeker, offset int64) (newOffset int64, err error)
- func Offset(seeker io.Seeker) (offset int64, err error)
- func Read[T any](reader io.ReadSeeker) (result T, err error)
- func ReadBlob(reader io.ReadSeeker) (blob []byte, err error)
- func ReadBytes(reader io.ReadSeeker, size uint64) (bytes []byte, err error)
- func ReadCollection(reader io.ReadSeeker, readCallback func(int) error) (err error)
- func ReadSerializable[T any, TPtr serializer.MarshalablePtr[T]](reader io.ReadSeeker, target TPtr, optFixedSize ...int) (err error)
- func Skip(seeker io.Seeker, offset int64) (newOffset int64, err error)
- func Write[T any](writer io.WriteSeeker, value T) (err error)
- func WriteBlob(writer io.WriteSeeker, blob []byte) (err error)
- func WriteCollection(writer io.WriteSeeker, ...) (err error)
- func WriteSerializable[T serializer.Byter](writer io.WriteSeeker, target T, optFixedSize ...int) (err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Read ¶
func Read[T any](reader io.ReadSeeker) (result T, err error)
Read reads a generic basic type from the stream.
func ReadBlob ¶
func ReadBlob(reader io.ReadSeeker) (blob []byte, err error)
ReadBlob reads a byte slice from the stream (the first 8 bytes are the length of the blob).
func ReadBytes ¶
func ReadBytes(reader io.ReadSeeker, size uint64) (bytes []byte, err error)
ReadBytes reads a byte slice of the given size from the stream.
func ReadCollection ¶
func ReadCollection(reader io.ReadSeeker, readCallback func(int) error) (err error)
ReadCollection reads a collection from the stream (the first 8 bytes are the length of the collection).
func ReadSerializable ¶
func ReadSerializable[T any, TPtr serializer.MarshalablePtr[T]](reader io.ReadSeeker, target TPtr, optFixedSize ...int) (err error)
ReadSerializable reads a serializable type from the stream (if the serialized field is of fixed size, we can provide the length to omit additional information about the length of the serializable).
func Write ¶
func Write[T any](writer io.WriteSeeker, value T) (err error)
Write writes a generic basic type from the stream.
func WriteBlob ¶
func WriteBlob(writer io.WriteSeeker, blob []byte) (err error)
WriteBlob writes a byte slice to the stream (the first 8 bytes are the length of the blob).
func WriteCollection ¶
func WriteCollection(writer io.WriteSeeker, writeCollection func() (elementsCount uint64, err error)) (err error)
WriteCollection writes a collection to the stream (the first 8 bytes are the length of the collection).
func WriteSerializable ¶
func WriteSerializable[T serializer.Byter](writer io.WriteSeeker, target T, optFixedSize ...int) (err error)
WriteSerializable writes a serializable type to the stream (if the serialized field is of fixed size, we can provide the length to omit additional information about the length of the serializable).
Types ¶
This section is empty.