Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
PinnedBufferMemoryStream.cs
Go to the documentation of this file.
2
3namespace System.IO;
4
6{
7 private readonly byte[] _array;
8
10
11 internal unsafe PinnedBufferMemoryStream(byte[] array)
12 {
13 _array = array;
15 int num = array.Length;
16 fixed (byte* pointer = &MemoryMarshal.GetReference<byte>(array))
17 {
18 Initialize(pointer, num, num, FileAccess.Read);
19 }
20 }
21
22 public override int Read(Span<byte> buffer)
23 {
24 return ReadCore(buffer);
25 }
26
27 public override void Write(ReadOnlySpan<byte> buffer)
28 {
30 }
31
33 {
34 Dispose(disposing: false);
35 }
36
37 protected override void Dispose(bool disposing)
38 {
40 {
42 }
43 base.Dispose(disposing);
44 }
45}
override int Read(Span< byte > buffer)
override void Dispose(bool disposing)
override void Write(ReadOnlySpan< byte > buffer)
void Dispose()
Definition Stream.cs:639
unsafe void WriteCore(ReadOnlySpan< byte > buffer)
unsafe void Initialize(SafeBuffer buffer, long offset, long length, FileAccess access)
unsafe int ReadCore(Span< byte > buffer)
static GCHandle Alloc(object? value)
Definition GCHandle.cs:81