Rework IO
This completely reworks the IO system of Inko, using proper byte array types where necessary, instead of using an array of integers. See c5897da0 for more details.
This fixes #108 (closed)
TODO
-
Close.close
should throw -
Change the documentation of Close
to indicate it's for closing files, sockets, etc, and not for disposing of regular objects -
read
should be given a requiredbuffer
argument, of typeArray!(Integer)
. Data is read into this buffer, instead of returning a new array. -
read
should be given an optionalsize
argument. If given, onlysize
bytes are read, otherwise all remaining bytes are read. -
read_string
should be added, which reads up tosize
bytes (or all remaining ones), and returns the result as a String -
Reading a single line should be implemented in just Inko, and the VM instructions should be removed -
write
takes aArray!(Integer)
, instead of aString
-
write_string
takes aString
-
StringFromBytes
should optionally drain the input Array. This allows for more efficient reading of data and converting it to a string, without relying on VM code. -
Clean up std::fs::file
using theobject ... impl
syntax
Edited by Yorick Peterse