public void AddInt(int value) { if (Error) { return; } if (_index + 4 >= PackerBufferSize) { Error = true; } else { _index = IntCompression.Pack(_buffer, _index, value); } }
public int GetInt() { if (Error) { return(0); } if (_index >= _endIndex) { Error = true; return(0); } _index = IntCompression.Unpack(_buffer, _index, out var result); if (_index > _endIndex) { Error = true; return(0); } return(result); }