« first day (2851 days earlier)      last day (652 days later) » 

8:36 AM
@Haris both evaluated as reference, please check the link for more information: doc.rust-lang.org/reference/expressions/method-call-expr.html
 
 
9 hours later…
5:40 PM
Are std::read_to_end/write_all designed to store integers, or just bytes? Because I always get garbled output when I try to store a [u8; 4096].
 
6:00 PM
std::read_to_end doesn't exist
then to answer you xyproblem.info
 
XD sry
 
@MachoOnion to be more clear, what are you really want to do ?
 
I am trying to read from a .dat file into a [u8; 4096]
Or, possibly a [u16] in the future
Sry bout this!
 
so you want read a file that contain u16 number encoded how ? little endian ? big endian ?
 
Little endian
I am not planning on porting this to a motorala, So yeah, LE
 
6:08 PM
do you know in advance how many numbers you read ?
or you just read as many as you can ?
 
4096
So I need it in a static array, not a vector, Again, Sry about this!
 
that not a trivial problem with rust using only std, I advice you use docs.rs/byteorder/latest/byteorder/… with a array let data = [0u16; 4096];
 

« first day (2851 days earlier)      last day (652 days later) »