Documentation ¶
Index ¶
- Constants
- func MeasureVarInt(value int32) int
- func ReadBool(r io.Reader) (bool, error)
- func ReadByte(r io.Reader) (byte, error)
- func ReadByteArray(r io.Reader) ([]byte, error)
- func ReadChatString(r io.Reader) (string, error)
- func ReadCollection[T any](r io.Reader, read ReadFunc[T]) (values []T, err error)
- func ReadEnum[T Enum](r io.Reader) (value T, err error)
- func ReadLong(r io.Reader) (int64, error)
- func ReadOptional[T any](r io.Reader, read ReadFunc[T]) (*T, error)
- func ReadOptionalFunc[T any](r io.Reader, read func(io.Reader) (T, error)) (*T, error)
- func ReadRaw(r io.Reader, length int) ([]byte, error)
- func ReadRemaining(r io.Reader) ([]byte, error)
- func ReadSizedString(r io.Reader, maxLength int) (string, error)
- func ReadString(r io.Reader) (string, error)
- func ReadTypedJSON[T any](r io.Reader) (result T, err error)
- func ReadUShort(r io.Reader) (uint16, error)
- func ReadUUID(r io.Reader) (string, error)
- func ReadVarInt(r io.Reader) (int32, error)
- func WriteBool(w io.Writer, value bool) error
- func WriteByte(w io.Writer, value byte) error
- func WriteByteArray(w io.Writer, value []byte) error
- func WriteChatString(w io.Writer, value string) error
- func WriteCollection[T any](w io.Writer, values []T, write WriteFunc[T]) error
- func WriteEnum[T Enum](w io.Writer, value T) error
- func WriteLong(w io.Writer, value int64) error
- func WriteOptionalFunc[T any](w io.Writer, value *T, write func(io.Writer, T) error) error
- func WriteRaw(w io.Writer, value []byte) error
- func WriteSizedString(w io.Writer, value string, maxLength int) error
- func WriteString(w io.Writer, value string) error
- func WriteTypedJSON[T any](w io.Writer, value T) error
- func WriteUShort(w io.Writer, value uint16) error
- func WriteUUID(w io.Writer, value string) error
- func WriteVarInt(w io.Writer, v int32) error
- type Enum
- type ReadFunc
- type WriteFunc
Constants ¶
View Source
const Remaining = -1
Variables ¶
This section is empty.
Functions ¶
func MeasureVarInt ¶
func ReadCollection ¶
func ReadOptionalFunc ¶
func ReadRaw ¶
ReadRaw reads a raw byte array from the reader. The length may be Remaining to read whatever is present
func WriteCollection ¶
func WriteOptionalFunc ¶
Types ¶
type Enum ¶
type Enum interface { constraints.Integer Validate() bool }
Click to show internal directories.
Click to hide internal directories.