Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
ImmutableByteArrayInterop.cs
Go to the documentation of this file.
3
5
6internal static class ImmutableByteArrayInterop
7{
8 [StructLayout(LayoutKind.Explicit)]
9 private struct ByteArrayUnion
10 {
11 [FieldOffset(0)]
12 internal byte[] UnderlyingArray;
13
14 [FieldOffset(0)]
16 }
17
19 {
20 byte[] underlyingArray = array;
21 array = null;
22 ByteArrayUnion byteArrayUnion = default(ByteArrayUnion);
23 byteArrayUnion.UnderlyingArray = underlyingArray;
24 return byteArrayUnion.ImmutableArray;
25 }
26
28 {
29 ByteArrayUnion byteArrayUnion = default(ByteArrayUnion);
30 byteArrayUnion.ImmutableArray = array;
31 return byteArrayUnion.UnderlyingArray;
32 }
33}
static ? byte[] DangerousGetUnderlyingArray(ImmutableArray< byte > array)
static ImmutableArray< byte > DangerousCreateFromUnderlyingArray(ref byte[]? array)