Re: svn commit: r505890 - in /jakarta/commons/proper/httpclient/trunk: release_notes.txt src/java/org/apache/commons/httpclient/AutoCloseInputStream.java src/test/org/apache/commons/httpclient/TestStr
On Wed, 2007-02-14 at 16:47 +1300, [EMAIL PROTECTED] wrote: Perhaps this should have an @since tag added, as it's a new method? Hi Simon, This change does not actually affect the public API. AutoCloseInputStream is a package private class and is not meant to be imported by the end users. Can we live without an @since for this method? Oleg [EMAIL PROTECTED] wrote: Modified: jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/AutoCloseInputStream.java URL: http://svn.apache.org/viewvc/jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/AutoCloseInputStream.java?view=diffrev=505890r1=505889r2=505890 == --- jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/AutoCloseInputStream.java (original) +++ jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/AutoCloseInputStream.java Sun Feb 11 03:25:25 2007 @@ -131,6 +131,23 @@ } /** + * Obtains the number of bytes that can be read without blocking. + * + * @return the number of bytes available without blocking + * @throws IOException in case of a problem + */ +public int available() throws IOException { +int a = 0; // not -1 + +if (isReadAllowed()) { +a = super.available(); +// no checkClose() here, available() can't trigger EOF +} + +return a; +} + - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: svn commit: r505890 - in /jakarta/commons/proper/httpclient/trunk: release_notes.txt src/java/org/apache/commons/httpclient/AutoCloseInputStream.java src/test/org/apache/commons/httpclient/TestStr
Oleg Kalnichevski [EMAIL PROTECTED] wrote: On Wed, 2007-02-14 at 16:47 +1300, [EMAIL PROTECTED] wrote: Perhaps this should have an @since tag added, as it's a new method? Hi Simon, This change does not actually affect the public API. AutoCloseInputStream is a package private class and is not meant to be imported by the end users. Can we live without an @since for this method? Oh, sure. Sorry I missed the fact that this wasn't a public class. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: svn commit: r505890 - in /jakarta/commons/proper/httpclient/trunk: release_notes.txt src/java/org/apache/commons/httpclient/AutoCloseInputStream.java src/test/org/apache/commons/httpclient/TestStr
Perhaps this should have an @since tag added, as it's a new method? [EMAIL PROTECTED] wrote: Modified: jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/AutoCloseInputStream.java URL: http://svn.apache.org/viewvc/jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/AutoCloseInputStream.java?view=diffrev=505890r1=505889r2=505890 == --- jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/AutoCloseInputStream.java (original) +++ jakarta/commons/proper/httpclient/trunk/src/java/org/apache/commons/httpclient/AutoCloseInputStream.java Sun Feb 11 03:25:25 2007 @@ -131,6 +131,23 @@ } /** + * Obtains the number of bytes that can be read without blocking. + * + * @return the number of bytes available without blocking + * @throws IOException in case of a problem + */ +public int available() throws IOException { +int a = 0; // not -1 + +if (isReadAllowed()) { +a = super.available(); +// no checkClose() here, available() can't trigger EOF +} + +return a; +} + - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]