Method TryBeginReadBits
TryBeginReadBits(uint)
Verifies the requested bit count can be read from the buffer. This exists as a separate method to allow multiple bit reads to be bounds checked with a single call. If it returns false, you may not read, and in editor and development builds, attempting to do so will throw an exception. In release builds, attempting to do so will read junk memory.
Declaration
public bool TryBeginReadBits(uint bitCount)
Parameters
Type | Name | Description |
---|---|---|
uint | bitCount | Number of bits you want to read, in total |
Returns
Type | Description |
---|---|
bool | True if you can read, false if that would exceed buffer bounds |