ref: d0f5ddad3688558a7bdfa185b8628e34d764c45b
dir: /test/bio-write.myr/
use std
use bio
const main = {
	var i
	var f
	/* Must be bigger than a bio buffer (ie, > 64k) */
	var buf : byte[64*1024]
	match bio.open("tmpout/test-write", bio.Wr)
	| `std.Some bio:	f = bio
	| `std.None:	std.fatal(1, "Unable to open data file")
	;;
	
	/* write a 5 byte chunk */
	bio.write(f, "test\n")
	/* again */
	bio.write(f, "test\n")
	/* write a 64k chunk */
	for i = 0; i < 64*1024; i++
		buf[i] = 0x31
	;;
	bio.write(f, buf[:])
	
	/* final message after a big burst */
	bio.write(f, "goodbye\n")
	/* and test for flush on close */
	bio.close(f);
}