sabermonk: in your program, check if stream.write(buf) === false