(this BinaryWriter stream, string str, int check)
| 625 | } |
| 626 | |
| 627 | internal static unsafe void WriteStrAnsi(this BinaryWriter stream, string str, int check) |
| 628 | { |
| 629 | int length = str?.Length ?? 0; |
| 630 | stream.Write(length); |
| 631 | if (length == 0) |
| 632 | return; |
| 633 | var bytes = System.Text.Encoding.ASCII.GetBytes(str); |
| 634 | if (bytes.Length != length) |
| 635 | throw new ArgumentException(); |
| 636 | fixed (byte* bytesPtr = bytes) |
| 637 | { |
| 638 | var ptr = bytesPtr; |
| 639 | for (int j = 0; j < length; j++) |
| 640 | ptr[j] = (byte)(ptr[j] ^ check); |
| 641 | } |
| 642 | stream.Write(bytes); |
| 643 | } |
| 644 | |
| 645 | internal static Guid ReadGuid(this BinaryReader stream) |
| 646 | { |
no test coverage detected