Uploaded image for project: 'UGENE'
  1. UGENE
  2. UGENE-903

LocalFileAdapter::skip() works incorrect in a very rare case

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Not a Bug
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Documentation
    • Labels:
      None

      Description

      You may use skip() function to return character to the steam (skip(-nChars)). When you read the block again, the reading must start from -nChars offset.

      But in the following case the function doesn't work.

      LocalFileAdapter has BUF_SIZE variable. Suppose BUF_SIZE=30.

      //pseudo code
      {
      io->readBlock(buf, 30);
      //30 first chars in the internal buffer

      io->readBlock(buf, 30);
      //30 next chars in the internal buffer

      io->skip(-35);
      //we cannot seek to the first buffer block because it's lost
      //and the next reading will not start from -35 offset
      }

      The bug came from "SNP project".

        Attachments

          Activity

            People

            Assignee:
            vaskin Yura Vaskin
            Reporter:
            vaskin Yura Vaskin
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: