The module `binary` adds services to `Writer` and `Reader` to read/write binary data.
The services offer different size for each kind of data. They can be used to save space on a stream or for compatibility with external programs. They use type names from C:
* `write_float` write a Nit `Float` on 32 bits, with loss of precision.
* `write_double` write a Nit `Float` on 64 bits.
* `write_int64` write a Nit `Int` on 64 bits, with usually no loss of data, but it may still happen per platform.
* `write_bool` and `write_bits` to write booleans as a byte.
* There's a TODO for other suggested methods.
The endianess of each stream is configurable.
I tried to avoid touching too much to the main stream code knowing that @R4PaSs is working on reading/writing bytes. The binary module will have to be updated when we have a `Byte` type. Also, all the others types of `Writer` must be modified to implement `write_byte`.
I'll use this to write a binary alternative to json_serialization.
Pull-Request: #1354
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>