Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
SecurityBuffer.cs
Go to the documentation of this file.
2
3namespace System.Net.Security;
4
5[StructLayout(LayoutKind.Auto)]
6internal struct SecurityBuffer
7{
8 public int offset;
9
10 public int size;
11
13
14 public byte[] token;
15
17
18 public SecurityBuffer(byte[] data, int offset, int size, SecurityBufferType tokentype)
19 {
20 this.offset = ((data != null && offset >= 0) ? Math.Min(offset, data.Length) : 0);
21 this.size = ((data != null && size >= 0) ? Math.Min(size, data.Length - this.offset) : 0);
22 type = tokentype;
23 token = ((size == 0) ? null : data);
24 unmanagedToken = null;
25 }
26
27 public SecurityBuffer(byte[] data, SecurityBufferType tokentype)
28 {
29 offset = 0;
30 size = ((data != null) ? data.Length : 0);
31 type = tokentype;
32 token = ((size == 0) ? null : data);
33 unmanagedToken = null;
34 }
35
36 public SecurityBuffer(int size, SecurityBufferType tokentype)
37 {
38 offset = 0;
39 this.size = size;
40 type = tokentype;
41 token = ((size == 0) ? null : new byte[size]);
42 unmanagedToken = null;
43 }
44}
static byte Min(byte val1, byte val2)
Definition Math.cs:912
System.Net.Security.SecurityBufferType type
SecurityBuffer(byte[] data, SecurityBufferType tokentype)
SecurityBuffer(int size, SecurityBufferType tokentype)
SecurityBuffer(byte[] data, int offset, int size, SecurityBufferType tokentype)