Пример #1
0
 public void WriteNullTerminatedString_Sync()
 {
     using (var f = new GenericFile())
     {
         var original = new byte[] { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x50, 0x6F, 0x6B, 0xC3, 0xA9, 0x6D, 0x6F, 0x01 };
         f.CreateFile(original);
         f.WriteNullTerminatedString(0, Encoding.UTF8, "Pokémon");
         f.WriteNullTerminatedString(9, Encoding.UTF8, "1234567");
         Assert.IsTrue(new byte[] { 0x50, 0x6F, 0x6B, 0xC3, 0xA9, 0x6D, 0x6F, 0x6E, 0x00, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x00 }.SequenceEqual(f.Read()));
     }
 }