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

◆ TryLoad16Bits()

uint System.IO.Compression.InputBuffer.TryLoad16Bits ( )
inline

Definition at line 40 of file InputBuffer.cs.

41 {
42 if (_bitsInBuffer < 8)
43 {
44 if (_buffer.Length > 1)
45 {
46 Span<byte> span = _buffer.Span;
47 _bitBuffer |= (uint)(span[0] << _bitsInBuffer);
48 _bitBuffer |= (uint)(span[1] << _bitsInBuffer + 8);
50 _bitsInBuffer += 16;
51 }
52 else if (_buffer.Length != 0)
53 {
54 _bitBuffer |= (uint)(_buffer.Span[0] << _bitsInBuffer);
56 _bitsInBuffer += 8;
57 }
58 }
59 else if (_bitsInBuffer < 16 && !_buffer.IsEmpty)
60 {
61 _bitBuffer |= (uint)(_buffer.Span[0] << _bitsInBuffer);
63 _bitsInBuffer += 8;
64 }
65 return _bitBuffer;
66 }
Memory< T > Slice(int start)
Definition Memory.cs:194
unsafe Span< T > Span
Definition Memory.cs:28
bool IsEmpty
Definition Memory.cs:25

References System.IO.Compression.InputBuffer._bitBuffer, System.IO.Compression.InputBuffer._bitsInBuffer, System.IO.Compression.InputBuffer._buffer, System.Memory< T >.IsEmpty, System.Memory< T >.Length, System.Memory< T >.Slice(), and System.Memory< T >.Span.