Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
add File.seek to Java API
[simgrid.git] / src / bindings / java / org / simgrid / msg / File.java
index 633f1ff..b1f13f9 100644 (file)
@@ -7,6 +7,9 @@
 package org.simgrid.msg;
 
 public class File {
+       public final int SEEK_SET = 0;
+       public final int SEEK_CUR = 1;
+       public final int SEEK_END = 2;
        /**
         * Represents the bind between the java comm and the
         * native C comm. You must never access it, since it is 
@@ -41,6 +44,15 @@ public class File {
         * @param nMemb is the number of elements of data to write 
         */
        public native long write(long size, long nMemb);
+       /**
+        * Write elements into a file. 
+        * @param offset : number of bytes to offset from origin
+        * @param origin : Position used as reference for the offset. It is specified by one of the following constants 
+        *                 defined in <stdio.h> exclusively to be used as arguments for this function (SEEK_SET = 
+        *                 beginning of file, SEEK_CUR = current position of the file pointer, SEEK_END = end of file)
+        */
+       public native void seek(long offset, long origin);
+
        /** Close the file. */
        public native void close();