structBytes
struct Bytes
buffer: int
capacity: int
used: int
endbytes: builds and reads binary data, like a file format. use "bytes.jamo"
A Bytes holds bytes in one buffer that doubles when it's full. Numbers go in and out little end first, the way Windows files and x86-64 store them. set_ changes bytes already added, which helps when a size or a place is only known later.
struct Bytes
buffer: int
capacity: int
used: int
endfunc new_bytes(): Bytes
func load_bytes(path: string): Bytes
The bytes of a file
func Bytes.room(extra: int)
func bytes_fits(value: int, low: int, high: int, kind: string)
func Bytes.add_u8(value: int)
A byte, from 0 to 255
func Bytes.add_u16(value: int)
2 bytes, from 0 to 65535
func Bytes.add_u32(value: int)
4 bytes, for anything from -2147483648 to 4294967295
func Bytes.add_u64(value: int)
8 bytes: any int
func Bytes.add_text(text: string)
The text's bytes, with nothing added at the end
func Bytes.pad_to(size: int)
Zero bytes until the length is a multiple of size, like 512 for a file section
func Bytes.length(): int
func Bytes.check_place(at: int, size: int)
func Bytes.get_u8(at: int): int
func Bytes.get_u16(at: int): int
func Bytes.get_u32(at: int): int
4 bytes read as a number from 0 to 4294967295
func Bytes.get_u64(at: int): int
func Bytes.set_u8(at: int, value: int)
func Bytes.set_u16(at: int, value: int)
func Bytes.set_u32(at: int, value: int)
func Bytes.set_u64(at: int, value: int)
func Bytes.text(): string
All the bytes as text, which can hold any bytes
func Bytes.save(path: string)