ByteOrder.java, [...]: Add code to load library with code for native methods if needed.
authorMichael Koch <konqueror@gmx.de>
Tue, 21 Oct 2003 12:55:02 +0000 (12:55 +0000)
committerMichael Koch <mkoch@gcc.gnu.org>
Tue, 21 Oct 2003 12:55:02 +0000 (12:55 +0000)
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.

From-SVN: r72747

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

index 42087e120a198d2460ce2e93eae6b092ff877fe5..f5bf330c93506d556dda320a381fb6af3171d03f 100644 (file)
@@ -1,3 +1,10 @@
+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,
index f1001a33b71cc1de97cdace8772746e73bdafce8..b4fcbe53a8beae510581f0ec87fa00115b8e00d8 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 4028b545d2591d83aa04e70dfaaf17765a01f081..a54c20693feb279ccdb38d1a8265c0000cd56767 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 85113a0287b6565de9fd63a7e15b2d3090a9d375..a14a7e1dd43185958411a4fabcba7c4d9d6091c9 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;