/// <summary>Promotes and inline usage map to a reference usage map.</summary> /// <remarks>Promotes and inline usage map to a reference usage map.</remarks> /// <exception cref="System.IO.IOException"></exception> private void PromoteInlineHandlerToReferenceHandler(int newPageNumber) { // copy current page number info to new references and then clear old int oldStartPage = _startPage; BitSet oldPageNumbers = (BitSet)_pageNumbers.Clone(); // clear out the main table (inline usage map data and start page) ClearTableAndPages(); // set the new map type _tableBuffer.Put(GetRowStart(), MAP_TYPE_REFERENCE); // write the new table data WriteTable(); // set new handler _handler = new UsageMap.ReferenceHandler(this); // update new handler with old data ReAddPages(oldStartPage, oldPageNumbers, newPageNumber); }
/// <exception cref="System.IO.IOException"></exception> private void InitHandler(byte mapType, bool assumeOutOfRangeBitsOn) { if (mapType == MAP_TYPE_INLINE) { _handler = new UsageMap.InlineHandler(this, assumeOutOfRangeBitsOn); } else { if (mapType == MAP_TYPE_REFERENCE) { _handler = new UsageMap.ReferenceHandler(this); } else { throw new IOException(MSG_PREFIX_UNRECOGNIZED_MAP + mapType); } } }