CrystalMpq.MpqFileStream.UpdateBuffer C# (CSharp) Method

UpdateBuffer() private method

private UpdateBuffer ( ) : void
return void
        private void UpdateBuffer()
        {
            if (position < 0 || position >= length) return;

            int newBlock = (int)(position / blockBuffer.Length);

            if (currentBlock != newBlock)
            {
                ReadBlock(newBlock);
                currentBlock = newBlock;
            }

            readBufferOffset = (int)(position % blockBuffer.Length);
        }