2003-10-21 Michael Koch <konqueror@gmx.de>
authormkoch <mkoch@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 21 Oct 2003 12:55:02 +0000 (12:55 +0000)
committermkoch <mkoch@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 21 Oct 2003 12:55:02 +0000 (12:55 +0000)
* 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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@72747 138bc75d-0d04-0410-961f-82ee72b054a4

libjava/ChangeLog
libjava/java/nio/ByteOrder.java
libjava/java/nio/DirectByteBufferImpl.java
libjava/java/nio/channels/FileChannelImpl.java

index 42087e1..f5bf330 100644 (file)
@@ -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 f1001a3..b4fcbe5 100644 (file)
@@ -38,6 +38,8 @@ exception statement from your version. */
 
 package java.nio;
 
+import gnu.classpath.Configuration;
+
 /**
  * @author Michael Koch
  * @since 1.4
@@ -47,6 +49,15 @@ public final class ByteOrder
   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 4028b54..a54c206 100644 (file)
@@ -38,10 +38,20 @@ exception statement from your version. */
 
 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 85113a0..a14a7e1 100644 (file)
@@ -47,6 +47,7 @@ import java.io.RandomAccessFile;
 import java.nio.ByteBuffer;
 import java.nio.MappedByteBuffer;
 import java.nio.MappedByteBufferImpl;
+import gnu.classpath.Configuration;
 import gnu.gcj.RawData;
 
 /**
@@ -59,6 +60,15 @@ import gnu.gcj.RawData;
 
 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;