This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

FYI: Patch: java.nio


Hi list,


I commited the attached patch to merge some files in java.nio again with 
classpath. The patch adds code to load a library for the native methods if 
needed.


Michael
Index: ChangeLog
===================================================================
RCS file: /cvs/gcc/gcc/libjava/ChangeLog,v
retrieving revision 1.2282
diff -u -b -B -r1.2282 ChangeLog
--- ChangeLog	21 Oct 2003 12:29:41 -0000	1.2282
+++ ChangeLog	21 Oct 2003 12:53:11 -0000
@@ -1,5 +1,12 @@
 2003-10-21  Michael Koch  <konqueror@gmx.de>
 
+	* java/nio/ByteOrder.java,
+	java/nio/DirectByteBufferImpl.java,
+	java/nio/channels/FileChannelImpl.java:
+	Add code to load library with code for native methods if needed.
+
+2003-10-21  Michael Koch  <konqueror@gmx.de>
+
 	* gnu/java/net/PlainDatagramSocketImpl.java,
 	gnu/java/net/PlainSocketImpl.java,
 	gnu/java/net/natPlainDatagramSocketImplPosix.cc,
Index: java/nio/ByteOrder.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/java/nio/ByteOrder.java,v
retrieving revision 1.2
diff -u -b -B -r1.2 ByteOrder.java
--- java/nio/ByteOrder.java	10 Mar 2003 15:31:03 -0000	1.2
+++ java/nio/ByteOrder.java	21 Oct 2003 12:53:11 -0000
@@ -38,6 +38,8 @@
 
 package java.nio;
 
+import gnu.classpath.Configuration;
+
 /**
  * @author Michael Koch
  * @since 1.4
@@ -47,6 +49,15 @@
   public static final ByteOrder BIG_ENDIAN     = new ByteOrder();
   public static final ByteOrder LITTLE_ENDIAN  = new ByteOrder();
 
+  static
+  {
+    // load the shared library needed for native methods.
+    if (Configuration.INIT_LOAD_LIBRARY)
+      {
+        System.loadLibrary ("javanio");
+      }
+  }
+  
   /**
    * Returns the native byte order of the platform currently running.
    */
Index: java/nio/DirectByteBufferImpl.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/java/nio/DirectByteBufferImpl.java,v
retrieving revision 1.5
diff -u -b -B -r1.5 DirectByteBufferImpl.java
--- java/nio/DirectByteBufferImpl.java	25 Sep 2003 06:43:52 -0000	1.5
+++ java/nio/DirectByteBufferImpl.java	21 Oct 2003 12:53:11 -0000
@@ -38,10 +38,20 @@
 
 package java.nio;
 
+import gnu.classpath.Configuration;
 import gnu.gcj.RawData;
 
 class DirectByteBufferImpl extends ByteBuffer
 {
+  static
+  {
+    // load the shared library needed for native methods.
+    if (Configuration.INIT_LOAD_LIBRARY)
+      {
+        System.loadLibrary ("javanio");
+      }
+  }
+  
   RawData address;
   private int offset;
   private boolean readOnly;
Index: java/nio/channels/FileChannelImpl.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/java/nio/channels/FileChannelImpl.java,v
retrieving revision 1.2
diff -u -b -B -r1.2 FileChannelImpl.java
--- java/nio/channels/FileChannelImpl.java	2 Aug 2003 11:17:40 -0000	1.2
+++ java/nio/channels/FileChannelImpl.java	21 Oct 2003 12:53:11 -0000
@@ -47,6 +47,7 @@
 import java.nio.ByteBuffer;
 import java.nio.MappedByteBuffer;
 import java.nio.MappedByteBufferImpl;
+import gnu.classpath.Configuration;
 import gnu.gcj.RawData;
 
 /**
@@ -59,6 +60,15 @@
 
 public class FileChannelImpl extends FileChannel
 {
+  static
+  {
+    // load the shared library needed for native methods.
+    if (Configuration.INIT_LOAD_LIBRARY)
+      {
+        System.loadLibrary ("javanio");
+      }
+  }
+  
   public RawData map_address;
   
   int length;

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]