On Monday, 28 September 2015 at 11:41:37 UTC, Gary Willoughby
A little criticism:
write(file, read(file, size));
truncate by reading/writing is not good sample at least for
official docs. It is not efficient. You can use POSIX truncate or
_chsize Windows system calls for truncation to specific length.
For zero it is simpler: open("file", "w+");
In Java world you can write OutputStream out = new
BufferedOutputStream(new FileOutputStream(fileName), BUF_SIZE);
It is not clear how to combine OutBuffer and write in such way.