| 78 | } |
| 79 | |
| 80 | MSChromatogram CachedmzML::getChromatogram(Size id) |
| 81 | { |
| 82 | OPENMS_PRECONDITION(id < getNrChromatograms(), "Id cannot be larger than number of chromatograms"); |
| 83 | |
| 84 | if ( !ifs_.seekg(chrom_index_[id]) ) |
| 85 | { |
| 86 | std::cerr << "Error while reading chromatogram " << id << " - seekg created an error when trying to change position to " << chrom_index_[id] << "." << std::endl; |
| 87 | std::cerr << "Maybe an invalid position was supplied to seekg, this can happen for example when reading large files (>2GB) on 32bit systems." << std::endl; |
| 88 | throw Exception::ParseError(__FILE__, __LINE__, OPENMS_PRETTY_FUNCTION, |
| 89 | "Error while changing position of input stream pointer.", filename_cached_); |
| 90 | } |
| 91 | |
| 92 | MSChromatogram c = meta_ms_experiment_.getChromatogram(id); |
| 93 | Internal::CachedMzMLHandler::readChromatogram(c, ifs_); |
| 94 | return c; |
| 95 | } |
| 96 | |
| 97 | size_t CachedmzML::getNrSpectra() const |
| 98 | { |