Read and write binary data with any Reader and Writer

var w = new FileWriter.open("/tmp/data.bin")
w.write "hello"
w.write_int64 123456789
w.write_byte 3
w.write_float 1.25
w.write_double 1.234567
w.write_bits(true, false, true)
assert w.last_error == null
w.close

var r = new FileReader.open("/tmp/data.bin")
assert r.read(5) == "hello"
assert r.read_int64 == 123456789
assert r.read_byte == 3
assert r.read_float == 1.25
assert r.read_double == 1.234567

var bits = r.read_bits
assert bits[0] and not bits[1] and bits[2]

assert r.last_error == null
r.close

All subgroups and modules

module binary

binary :: binary

Read and write binary data with any Reader and Writer
package_diagram binary\> binary core core binary\>->core msgpack msgpack msgpack->binary\> gamnit gamnit gamnit->msgpack gamnit... ... gamnit...->gamnit

Ancestors

group codecs

core > codecs

Group module for all codec-related manipulations
group collection

core > collection

This module define several collection classes.
group text

core > text

All the classes and methods related to the manipulation of text entities

Parents

group core

core

Nit common library of core classes and methods

Children

group msgpack

msgpack

MessagePack, an efficient binary serialization format

Descendants

group network

gamnit > network

Easy client/server logic for games and simple distributed applications