Hi,

Aaron M. Renn wrote:
> Jeroen Frijters ([EMAIL PROTECTED]) wrote:
> > - FileOutputStream should not request read access, so the 
> modes should
> > be "w" and "a"
> 
> Good observation.  Have you actually tested the JDK to see what it
> does in this situation?  Is the file actually opened "write only"?

Yes, I have. Test code is attached (it should fail with
"java.io.IOException: Access is denied"). Additionally, FileOutputStream
(when it is not in append mode) should truncate the file if it already
exists, so it also needs to use a different mode because of this.

> > - write(byte[] buf, long offset, long length) should not 
> use longs for
> > offset and length
> 
> I take it that you are referring to the Java write() method I 
> added to the
> FileDescriptor class and not the nativeWriteBuf() method.  I'm ok with
> modifying this.  

Yes.

>I do typically want to use longs for native calls.

Why? Is it expensive to use ints on 64 bit architectures?

> > - nativeReadByte shouldn't return a long
> 
> Why not?  All of the rest of the native methods that return values
> return longs.

I missed the others. IMHO only file offsets and native pointers should
be long, all others should be the most natural type. In this case I
think that's int.

> > - I don't think available() should return negative numbers
> 
> Does it?  I certainly didn't intend for it to.

Not it doesn't, sorry, apparantly I wasn't awake yet.

Regards,
Jeroen

P.S. I'm going on vacation for a week and I won't be able to read my
e-mail.

Attachment: iotest.java
Description: iotest.java

_______________________________________________
Classpath mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/classpath

Reply via email to