Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
85ae3de00074db1a603a8c67b39cd27415593d29
[simgrid.git] / docs / source / java / org / simgrid / msg / File.rst
1 class org.simgrid.msg.File
2 ==========================
3
4 .. java:package:: org.simgrid.msg
5    :noindex:
6
7 .. java:type:: public class File
8
9 Fields
10 ------
11 SEEK_CUR
12 ^^^^^^^^
13
14 .. java:field:: public static final int SEEK_CUR
15    :outertype: File
16
17 SEEK_END
18 ^^^^^^^^
19
20 .. java:field:: public static final int SEEK_END
21    :outertype: File
22
23 SEEK_SET
24 ^^^^^^^^
25
26 .. java:field:: public static final int SEEK_SET
27    :outertype: File
28
29 Constructors
30 ------------
31 File
32 ^^^^
33
34 .. java:constructor:: public File(String path)
35    :outertype: File
36
37    Constructor, opens the file.
38
39    :param path: is the file location on the storage
40
41 Methods
42 -------
43 close
44 ^^^^^
45
46 .. java:method:: public native void close()
47    :outertype: File
48
49    Close the file.
50
51 nativeInit
52 ^^^^^^^^^^
53
54 .. java:method:: public static native void nativeInit()
55    :outertype: File
56
57    Class initializer, to initialize various JNI stuff
58
59 open
60 ^^^^
61
62 .. java:method:: protected native void open(String path)
63    :outertype: File
64
65    Opens the file whose name is the string pointed to by path.
66
67    :param path: is the file location on the storage
68
69 read
70 ^^^^
71
72 .. java:method:: public native long read(long size, long nMemb)
73    :outertype: File
74
75    Read elements of a file.
76
77    :param size: of each element
78    :param nMemb: is the number of elements of data to write
79    :return: the actually read size
80
81 seek
82 ^^^^
83
84 .. java:method:: public native void seek(long offset, long origin)
85    :outertype: File
86
87    Write elements into a file.
88
89    :param offset: : number of bytes to offset from origin
90    :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)
91
92 write
93 ^^^^^
94
95 .. java:method:: public native long write(long size, long nMemb)
96    :outertype: File
97
98    Write elements into a file.
99
100    :param size: of each element
101    :param nMemb: is the number of elements of data to write
102    :return: the actually written size
103