harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Geir Magnusson Jr <g...@pobox.com>
Subject [classlib][luni] Problem with java.io.OutputStream
Date Mon, 14 Aug 2006 16:15:53 GMT
When looking at HARMONY-1156, it became clear that our
java.io.OutputStream isn't right.

I'd like to make the following changes :

Follow the spec so that an IndexOOBE is thrown when :

a) offset is negative or
b) len is negative or
c) off + len > buff.length

So in the case of

   write( byte[count], count, 0);

for any value of count >= 0, then none of the conditions are true, and
it should simply [quickly] return.

Now, the spec says that if the array is null, then a NPE should be
thrown, but this doesn't happen in the RI when len = 0.

This seems to be a reasonable thing to do, and therefore I think that we
should match the RI here, and not the spec.

Comments?

geir


---------------------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
For additional commands, e-mail: harmony-dev-help@incubator.apache.org


Mime
View raw message