classpath-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[cp-patches] [Patch] java.nio.channels.Channels improved


From: Michael Koch
Subject: [cp-patches] [Patch] java.nio.channels.Channels improved
Date: Wed, 12 Jan 2005 11:15:29 +0100
User-agent: Mutt/1.5.6+20040907i

Hi list,


I commited the attached patch to implement optimized handling of file
channels in java.nio.channels.Channels. The default implementation
returns a FileInputStream with newInputStream() and a FileOutputStream
for newOutputStream() for FileChannel objects given to them. It uses
reflection to instantiate the needed stream objects in this case. VMs
can overwrite this easily, e.g. GCJ will do this much more easily using
CNI without the need for reflection. The functionality was proved by
new mauve testcases.


Michael


2005-01-12  Michael Koch  <address@hidden>

        * java/nio/channels/Channels.java
        (newInputStream(ReadableByteChannel)):
        Call VMChannels.newInputStream(ReadableByteChannel).
        (newOutputStream(WritableByteChannel):
        Call VMChannels.newOutputStream(WritableByteChannel).
        (newInputStream(FileChannelImpl)): Removed.
        (newOutputStream(FileChannelImpl)): Likewise.
        * vm/reference/java/nio/channels/VMChannels.java: New file.
        * native/jni/java-nio/Makefile.am:
        * native/jni/java-nio/java_nio_channels_Channels.c,
        include/java_nio_channels_Channels.h: Removed.
        * include/Makefile.am: Don't generate java_nio_channels_Channels.h.
        Removed java_nio_channels_Channels.c.

Attachment: nio.diff
Description: Text document


reply via email to

[Prev in Thread] Current Thread [Next in Thread]