Free cookie consent management tool by TermsFeed Policy Generator

Changeset 13925 for trunk


Ignore:
Timestamp:
06/20/16 14:50:25 (8 years ago)
Author:
gkronber
Message:

#2071: TableFileParser: check if it is possible to seek in file before trying to access position (=> reduce number of exceptions)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Problems.Instances.DataAnalysis/3.3/TableFileParser.cs

    r13584 r13925  
    514514          CurrentLine = reader.ReadLine();
    515515          CurrentLineNumber++;
    516           try {
     516          if (reader.BaseStream.CanSeek) {
    517517            BytesRead = reader.BaseStream.Position;
    518           }
    519           catch (IOException) {
     518          } else {
    520519            BytesRead += CurrentLine.Length + 2; // guess
    521           }
    522           catch (NotSupportedException) {
    523             BytesRead += CurrentLine.Length + 2;
    524520          }
    525521          int i = 0;
Note: See TracChangeset for help on using the changeset viewer.