Files
io/source.go
T
2025-05-26 03:15:35 +03:00

43 lines
1019 B
Go

package universe_io
type Source interface {
Read(dst []byte) (n int, err error)
}
type BufferedSource interface {
Source
ReadByte() (byte, error)
ReadUByte() (uint8, error)
ReadShortLE() (int16, error)
ReadShortBE() (int16, error)
ReadIntLE() (int32, error)
ReadIntBE() (int32, error)
ReadLongLE() (int64, error)
ReadLongBE() (int64, error)
ReadUShortLE() (uint16, error)
ReadUShortBE() (uint16, error)
ReadUIntLE() (uint32, error)
ReadUIntBE() (uint32, error)
ReadULongLE() (uint64, error)
ReadULongBE() (uint64, error)
ReadFloatLE() (float32, error)
ReadFloatBE() (float32, error)
ReadDoubleLE() (float64, error)
ReadDoubleBE() (float64, error)
// ReadShortByteArray reads a size-prefixed byte array.
// Structure: [ShortLE : size][size bytes data]
ReadShortByteArray() ([]byte, error)
// ReadByteArray reads a size-prefixed byte array.
// Structure: [IntLE : size][size bytes data]
ReadByteArray() ([]byte, error)
ReadShortString() (string, error)
ReadString() (string, error)
}