<!-- 
RSS generated by JIRA (4.4#649-r158309) at Sat May 18 20:53:54 CDT 2013

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 add field=key&field=summary to the URL of your request.
For example:
http://dev.clojure.org/jira/si/jira.issueviews:issue-xml/CLJ-1089/CLJ-1089.xml?field=key&field=summary
-->
<rss version="0.92" >
<channel>
    <title>Clojure JIRA</title>
    <link>http://dev.clojure.org/jira</link>
    <description>This file is an XML representation of an issue</description>
    <language>en-us</language>    <build-info>
        <version>4.4</version>
        <build-number>649</build-number>
        <build-date>25-07-2011</build-date>
    </build-info>

<item>
            <title>[CLJ-1089] clojure.java.io/copy interprets read count of 0 as eos</title>
                <link>http://dev.clojure.org/jira/browse/CLJ-1089</link>
                <project id="10010" key="CLJ">Clojure</project>
                        <description>&lt;p&gt;According to the interface &lt;a href=&quot;http://docs.oracle.com/javase/6/docs/api/java/io/InputStream.html#read(&quot;&gt;http://docs.oracle.com/javase/6/docs/api/java/io/InputStream.html#read(&lt;/a&gt;)&lt;br/&gt;
InputStream.read() family of methods return -1 when the end of stream is reached.&lt;/p&gt;

&lt;p&gt;do-copy methods currently use a test: (pos? size) to determine whether eos is reached. This mostly works, but the specification is pretty clear in that InputStream implementations are allowed to return reads of zero bytes before returning more bytes.&lt;/p&gt;

&lt;p&gt;##EDIT changed title of ticket from &quot;clojure.java.io/copy should test for -1 instead of 0 for end of stream&quot;&lt;/p&gt;</description>
                <environment></environment>
            <key id="15767">CLJ-1089</key>
            <summary>clojure.java.io/copy interprets read count of 0 as eos</summary>
                <type id="1" iconUrl="http://dev.clojure.org/jira/images/icons/bug.gif">Defect</type>
                                <priority id="4" iconUrl="http://dev.clojure.org/jira/images/icons/priority_minor.gif">Minor</priority>
                    <status id="6" iconUrl="http://dev.clojure.org/jira/images/icons/status_closed.gif">Closed</status>
                    <resolution id="2">Declined</resolution>
                                <assignee username="-1">Unassigned</assignee>
                                <reporter username="bendlas">Herwig Hochleitner</reporter>
                        <labels>
                    </labels>
                <created>Mon, 22 Oct 2012 15:35:15 -0500</created>
                <updated>Mon, 22 Oct 2012 16:57:16 -0500</updated>
                    <resolved>Mon, 22 Oct 2012 16:57:16 -0500</resolved>
                                                                    <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="29758" author="bendlas" created="Mon, 22 Oct 2012 15:40:47 -0500"  >&lt;p&gt;Attached patch changes do-copy methods to test for -1&lt;/p&gt;</comment>
                    <comment id="29759" author="jafingerhut" created="Mon, 22 Oct 2012 16:56:34 -0500"  >&lt;p&gt;Herwig, can you elaborate on &quot;the specification is pretty clear in that InputStream implementations are allowed to return reads of zero bytes before returning more bytes&quot;?&lt;/p&gt;

&lt;p&gt;I ask because in the very InputStream documentation page you link to, it seems to explicitly say the opposite of what you claim: &quot;If no byte is available because the stream is at the end of the file, the value -1 is returned; otherwise, at least one byte is read and stored into b.&quot;&lt;/p&gt;</comment>
                    <comment id="29760" author="bendlas" created="Mon, 22 Oct 2012 16:57:16 -0500"  >&lt;p&gt;I reread the spec for InputStream.read and it clearly says &lt;/p&gt;

&lt;p&gt;&quot;If no byte is available because the stream is at the end of the file, the value -1 is returned; otherwise, at least one byte is read and stored into b.&quot;&lt;/p&gt;

&lt;p&gt;The reason I originally thought of this as an issue was a misbehaving ServletInputStream from Jetty.&lt;/p&gt;

&lt;p&gt;I closed the issue as declined. Sorry for the noise!&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="11599" name="0001-CLJ-1089-clojure.java.io-do-copy-methods-determine-e.patch" size="1984" author="bendlas" created="Mon, 22 Oct 2012 15:40:47 -0500" />
                </attachments>
            <subtasks>
        </subtasks>
                <customfields>
                                                                                            <customfield id="customfield_10010" key="com.pyxis.greenhopper.jira:gh-global-rank">
                <customfieldname>Global Rank</customfieldname>
                <customfieldvalues>
                    
                </customfieldvalues>
            </customfield>
                                                                                                            </customfields>
    </item>
</channel>
</rss>