Uploaded image for project: 'Commons VFS'
  1. Commons VFS
  2. VFS-355

RamFileProvider: ReadingRamFileRandomAccessContent InputStream of file does not return -1 when empty...

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.0
    • Fix Version/s: 2.1
    • Labels:
      None
    • Environment:

      N/A

      Description

      RamFileRandomAccessContent

      public int read(byte b[], int off, int len) throws IOException

      { int retLen = Math.min(len, getLeftBytes()); RamFileRandomAccessContent.this.readFully(b, off, retLen); return retLen; }

      Notice retLen should return 1 if getLeftBytes() returns 0 but it doesnt. When empty it simply returns 0 which means if one reads until -1 it never happens...

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              mp1 Miroslav Pokorny
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: