1 /* Copyright (c) 2012-2014. The SimGrid Team.
2 * All rights reserved. */
4 /* This program is free software; you can redistribute it and/or modify it
5 * under the terms of the license (GNU LGPL) which comes with this package. */
7 package org.simgrid.msg;
11 * Represents the bind between the java comm and the
12 * native C comm. You must never access it, since it is
15 private long bind = 0;
17 * Constructor, opens the file.
18 * @param path is the file location on the storage
20 public File(String path) {
24 protected void finalize() {
28 * Opens the file whose name is the string pointed to by path.
29 * @param path is the file location on the storage
31 protected native void open(String path);
33 * Read elements of a file.
34 * @param size of each element
35 * @param nMemb is the number of elements of data to write
37 public native long read(long size, long nMemb);
39 * Write elements into a file.
40 * @param size of each element
41 * @param nMemb is the number of elements of data to write
43 public native long write(long size, long nMemb);
47 public native void close();
49 /** Class initializer, to initialize various JNI stuff */
50 public static native void nativeInit();
52 org.simgrid.NativeLib.nativeInit();