Uploaded image for project: 'Tika'
  1. Tika
  2. TIKA-2637

ParsingReader.read throws exception when no bytes are available

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.0.0, 1.20
    • Component/s: None
    • Labels:
      None

      Description

      Calling ParsingReader.read on an "empty" reader throws an exception:

      org.apache.tika.exception.ZeroByteFileException: InputStream must have > 0 bytes
      

      However, according to the Reader documentation:

      Returns:
      The number of characters read, or -1 if the end of the stream has been reached
      

      So this method should return a -1 instead.

        Attachments

          Activity

            People

            • Assignee:
              tallison Tim Allison
              Reporter:
              boris-petrov Boris Petrov
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: