<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 08:53:45 UTC 2024

It is possible to restrict the fields that are returned in this document by specifying the 'field' parameter in your request.
For example, to request only the issue key and summary append 'field=key&field=summary' to the URL of your request.
-->
<rss version="0.92" >
<channel>
    <title>MongoDB Jira</title>
    <link>https://jira.mongodb.org</link>
    <description>This file is an XML representation of an issue</description>
    <language>en-us</language>    <build-info>
        <version>9.7.1</version>
        <build-number>970001</build-number>
        <build-date>13-04-2023</build-date>
    </build-info>


<item>
            <title>[JAVA-1074] InputStream read() not behaving as expected by Interface Javadoc</title>
                <link>https://jira.mongodb.org/browse/JAVA-1074</link>
                <project id="10006" key="JAVA">Java Driver</project>
                    <description>&lt;p&gt;The read(final byte[] b, final int off, final int len) method is supposed to try to retrieve the number of bytes specified in &apos;len&apos;. 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.&lt;/p&gt;</description>
                <environment></environment>
        <key id="105618">JAVA-1074</key>
            <summary>InputStream read() not behaving as expected by Interface Javadoc</summary>
                <type id="4" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14710&amp;avatarType=issuetype">Improvement</type>
                                            <priority id="3" iconUrl="https://jira.mongodb.org/images/icons/priorities/major.svg">Major - P3</priority>
                        <status id="6" iconUrl="https://jira.mongodb.org/images/icons/statuses/closed.png" description="The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.">Closed</status>
                    <statusCategory id="3" key="done" colorName="success"/>
                                    <resolution id="9">Done</resolution>
                                        <assignee username="-1">Unassigned</assignee>
                                    <reporter username="Steve Hummingbird">Steve Hummingbird</reporter>
                        <labels>
                    </labels>
                <created>Sat, 11 Jan 2014 00:15:17 +0000</created>
                <updated>Sun, 12 Jan 2014 15:16:40 +0000</updated>
                            <resolved>Sun, 12 Jan 2014 15:16:40 +0000</resolved>
                                                                    <component>GridFS</component>
                                        <votes>0</votes>
                                    <watches>2</watches>
                                                                                                                <comments>
                            <comment id="480736" author="jeff.yemin" created="Sun, 12 Jan 2014 15:16:40 +0000"  >&lt;p&gt;Thanks for your understanding.  I&apos;m going to close this issue, as the current behavior is consistent with the documentation of InputStream.read, and with the actual behavior of other implementations of this method, in particular SocketInputStream.&lt;/p&gt;</comment>
                            <comment id="480652" author="steve hummingbird" created="Sat, 11 Jan 2014 11:45:01 +0000"  >&lt;p&gt;Thanks for the comment. I can now see that this leaves quite some room for interpretation. Probably that&apos;s some sort of nit-picking, but currently the attempt is made to read up to one chunk size, in case &apos;len&apos; is greater than the chunk size - instead of attempting to read &apos;len&apos; bytes.&lt;br/&gt;
The issue I am seeing is that the caller can not know about the reason for less bytes being retrieved than requested. If the implementation of the stream would really attempt to read up to &apos;len&apos; bytes, this would lead to less round trips in some cases.&lt;br/&gt;
As GridFS is designed to handle large documents, I would expect it to be able to fetch larger amounts of data without requiring manual assembly of the chunks. But I am aware of that this might be seen differently, so please close this issue if that&apos;s the case.&lt;/p&gt;</comment>
                            <comment id="480544" author="jeff.yemin" created="Sat, 11 Jan 2014 01:11:57 +0000"  >&lt;p&gt;It&apos;s not clear to me how you came to this conclusion.  The Javadoc for this method states:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Reads up to len bytes of data from the input stream into an array of bytes. An attempt is made to read as many as len bytes, but a smaller number may be read. The number of bytes actually read is returned as an integer.&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;Can you explain your reasoning?&lt;/p&gt;

</comment>
                    </comments>
                    <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                                                                                                                                                                                        <customfield id="customfield_10011" key="com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons">
                        <customfieldname>Backwards Compatibility</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10038"><![CDATA[Fully Compatible]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_15850" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hrvbb3:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10558" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>96665</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            </customfields>
    </item>
</channel>
</rss>