Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
PEMemoryBlock.cs
Go to the documentation of this file.
4
6
7public readonly struct PEMemoryBlock
8{
9 private readonly AbstractMemoryBlock _block;
10
11 private readonly int _offset;
12
13 public unsafe byte* Pointer
14 {
15 get
16 {
17 if (_block == null)
18 {
19 return null;
20 }
21 return _block.Pointer + _offset;
22 }
23 }
24
25 public int Length => (_block?.Size - _offset).GetValueOrDefault();
26
27 internal PEMemoryBlock(AbstractMemoryBlock block, int offset = 0)
28 {
29 _block = block;
31 }
32
33 public unsafe BlobReader GetReader()
34 {
35 return new BlobReader(Pointer, Length);
36 }
37
38 public unsafe BlobReader GetReader(int start, int length)
39 {
41 return new BlobReader(Pointer + start, length);
42 }
43
48
54}
static readonly ImmutableArray< T > Empty
static void ValidateRange(int bufferLength, int start, int byteCount, string byteCountParameterName)
virtual unsafe ImmutableArray< byte > GetContentUnchecked(int start, int length)
PEMemoryBlock(AbstractMemoryBlock block, int offset=0)
ImmutableArray< byte > GetContent(int start, int length)
unsafe BlobReader GetReader(int start, int length)