/** * Load the names if they haven't already been loaded. * * @throws IOException if an I/O related error occurs */ private void loadNames() throws IOException { mNames = new PrereadNames(mDirectory, mRegion, false); if (mIndexFile.getVersion() >= IndexFile.SEPARATE_CHECKSUM_VERSION && mRegion.getStart() == 0 && mRegion.getEnd() == mIndexFile.getNumberSequences()) { if (mNames.calcChecksum() != mIndexFile.getNameChecksum()) { throw new CorruptSdfException( "Sequence names failed checksum - SDF may be corrupt: \"" + mDirectory + "\""); } else { Diagnostic.developerLog("Sequence names passed checksum"); } } }
private void loadNameSuffixes(boolean attemptLoad, boolean suffixExists) throws IOException { mNameSuffixes = attemptLoad && suffixExists ? new PrereadNames(mDirectory, mRegion, true) : new EmptyStringPrereadNames(mEnd - mStart); if (attemptLoad && suffixExists) { if (mRegion.getStart() == 0 && mRegion.getEnd() == mIndexFile.getNumberSequences()) { if (mNameSuffixes.calcChecksum() != mIndexFile.getNameSuffixChecksum()) { throw new CorruptSdfException( "Sequence name suffixes failed checksum - SDF may be corrupt: \"" + mDirectory + "\""); } else { Diagnostic.developerLog("Sequence name suffixes passed checksum"); } } } }