MCPcopy Create free account
hub / github.com/FlaxEngine/FlaxEngine / WriteStrAnsi

Method WriteStrAnsi

Source/Editor/Utilities/Utils.cs:627–643  ·  view source on GitHub ↗
(this BinaryWriter stream, string str, int check)

Source from the content-addressed store, hash-verified

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 {

Callers 4

WriteVariantTypeMethod · 0.80
WriteVariantMethod · 0.80
SaveSignatureMethod · 0.80
SaveMethod · 0.80

Calls 1

WriteMethod · 0.45

Tested by

no test coverage detected