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

ParsingReader.read throws exception when no bytes are available

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Critical
    • Resolution: Fixed
    • None
    • 2.0.0, 1.20
    • None
    • 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

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

            Dates

              Created:
              Updated:
              Resolved: