Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ GetBlock() [2/2]

Memory< byte > System.Net.MultiMemory.GetBlock ( int blockIndex)
inline

Definition at line 44 of file MultiMemory.cs.

45 {
46 if ((uint)blockIndex >= BlockCount)
47 {
48 throw new IndexOutOfRangeException();
49 }
50 uint num = ((blockIndex == 0) ? GetOffsetInBlock(_start) : 0u);
51 uint num2 = ((blockIndex == BlockCount - 1) ? (GetOffsetInBlock(_start + _length - 1) + 1) : 16384u);
52 return new Memory<byte>(_blocks[GetBlockIndex(_start) + blockIndex], (int)num, (int)(num2 - num));
53 }
readonly byte[][] _blocks
Definition MultiMemory.cs:8
static uint GetOffsetInBlock(uint offset)
readonly uint _start
readonly uint _length
static uint GetBlockIndex(uint offset)

References System.Net.MultiMemory._blocks, System.Net.MultiMemory._length, System.Net.MultiMemory._start, System.Net.MultiMemory.BlockCount, System.Net.MultiMemory.GetBlockIndex(), and System.Net.MultiMemory.GetOffsetInBlock().