Package org.simgrid.msg
Class File
- java.lang.Object
-
- org.simgrid.msg.File
-
public class File extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description File(java.lang.String path)
Constructor, opens the file.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
Close the file.static void
nativeInit()
Class initializer, to initialize various JNI stuffprotected void
open(java.lang.String path)
Opens the file whose name is the string pointed to by path.long
read(long size, long nMemb)
Read elements of a file.void
seek(long offset, long origin)
Write elements into a file.long
write(long size, long nMemb)
Write elements into a file.
-
-
-
Field Detail
-
SEEK_SET
public static final int SEEK_SET
- See Also:
- Constant Field Values
-
SEEK_CUR
public static final int SEEK_CUR
- See Also:
- Constant Field Values
-
SEEK_END
public static final int SEEK_END
- See Also:
- Constant Field Values
-
-
Method Detail
-
open
protected void open(java.lang.String path)
Opens the file whose name is the string pointed to by path.- Parameters:
path
- is the file location on the storage
-
read
public long read(long size, long nMemb)
Read elements of a file.- Parameters:
size
- of each elementnMemb
- is the number of elements of data to write- Returns:
- the actually read size
-
write
public long write(long size, long nMemb)
Write elements into a file.- Parameters:
size
- of each elementnMemb
- is the number of elements of data to write- Returns:
- the actually written size
-
seek
public void seek(long offset, long origin)
Write elements into a file.- Parameters:
offset
- : number of bytes to offset from originorigin
- : 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)
-
close
public void close()
Close the file.
-
nativeInit
public static void nativeInit()
Class initializer, to initialize various JNI stuff
-
-