I suppose so. Binary file IO doesn't translate '\n' into platform-specific end-of-line sequence which would corrupt data where '\n' does not have that meaning (when you output the bytes of an integer, it might well contain bytes with the value of '\n').