Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
ExternalMemoryBlockProvider.cs
Go to the documentation of this file.
1using System.IO;
2
4
6{
7 private unsafe byte* _memory;
8
9 private int _size;
10
11 public override int Size => _size;
12
13 public unsafe byte* Pointer => _memory;
14
15 public unsafe ExternalMemoryBlockProvider(byte* memory, int size)
16 {
17 _memory = memory;
18 _size = size;
19 }
20
21 protected unsafe override AbstractMemoryBlock GetMemoryBlockImpl(int start, int size)
22 {
23 return new ExternalMemoryBlock(this, _memory + start, size);
24 }
25
26 public unsafe override Stream GetStream(out StreamConstraints constraints)
27 {
28 constraints = new StreamConstraints(null, 0L, _size);
30 }
31
32 protected unsafe override void Dispose(bool disposing)
33 {
34 _memory = null;
35 _size = 0;
36 }
37}
unsafe override Stream GetStream(out StreamConstraints constraints)
unsafe override AbstractMemoryBlock GetMemoryBlockImpl(int start, int size)