Uploaded image for project: 'Java Driver'
  1. Java Driver
  2. JAVA-1074

InputStream read() not behaving as expected by Interface Javadoc

    XMLWordPrintableJSON

Details

    • Icon: Improvement Improvement
    • Resolution: Done
    • Icon: Major - P3 Major - P3
    • None
    • None
    • GridFS
    • None
    • Fully Compatible

    Description

      The read(final byte[] b, final int off, final int len) method is supposed to try to retrieve the number of bytes specified in 'len'. The current implementation however only retrieves one chunk and reads that chunk. In most cases this leads to less bytes being retrieved than requested. This usually puts the burden on the application to loop over that method until the number of requested bytes could be retrieved. It should be considered if this work can be handled by the driver - at least for the 3.0 update. Unless someone expects the current behaviour, which differs from the javadoc for the Inputstream (which is the only documentation I could find), this change should not break backwards compatibility.

      Attachments

        Activity

          People

            Unassigned Unassigned
            Steve Hummingbird Steve Hummingbird
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: