


write the new byte array into the fileī4 = (byte)(b3 ^ (byte)10) //xor 10į1 = new FileStream("test.txt", FileMode.Open, FileAccess. When a file becomes 0 bytes, it usually means that something goes wrong with the file system or storage device. In other words, the file contains no content that can be written and read. using System į1 = new FileStream("test.txt", FileMode.Create, FileAccess.Write) į1 = new FileStream("test.txt", FileMode.Open, FileAccess.Read) ī2 = (byte)(b2 ^ (byte)10) //xor 10į1 = new FileStream("test.txt", FileMode.Open, FileAccess.Write) A zero-byte file means that there is no data being stored in the file and the length of the file also becomes zero. The file is always 6 bytes in size, since it writes at position 0. It does an XOR operation with the bytes so that the result written to the file is the same as the original starting values. This example reads 6 bytes into a byte array and writes it to another byte array.
