/// <summary> /// Deserializes a block. /// </summary> /// <param name="blockIdx"></param> private void DeserializeBlock(int blockIdx) { // calculate current bounds. _currentBlockMin = (uint)(blockIdx * _blockSize); // move stream to correct position. int blockOffset = 0; if (blockIdx > 0) { blockOffset = _blockPositions[blockIdx - 1]; } // seek stream. _stream.Seek(blockOffset + _begin, SeekOrigin.Begin); // deserialize this block. _currentBlock = TagIndexSerializer.Deserialize(_stream); }
/// <summary> /// Deserializes a block. /// </summary> /// <param name="blockIdx"></param> private void DeserializeBlock(int blockIdx) { // calculate current bounds. _currentBlockMin = (uint)(blockIdx * _blockSize); // move stream to correct position. int blockOffset = 0; if (blockIdx > 0) { blockOffset = _blockPositions[blockIdx - 1]; } // seek stream. _stream.Seek(blockOffset + _begin, SeekOrigin.Begin); // deserialize this block. Ionic.Zlib.GZipStream gzipStream = new Ionic.Zlib.GZipStream(_stream, Ionic.Zlib.CompressionMode.Decompress); _currentBlock = TagIndexSerializer.Deserialize(gzipStream); }