1 package org.simgrid.msg;
3 * Copyright 2012 The SimGrid team. All right reserved.
5 * This program is free software; you can redistribute
6 * it and/or modify it under the terms of the license
7 * (GNU LGPL) which comes with this package.
12 protected String storage;
14 * Represents the bind between the java comm and the
15 * native C comm. You must never access it, since it is
18 private long bind = 0;
20 * Constructor, opens the file.
21 * @param storage is the name where you can find the file descriptor
22 * @param path is the file location on the storage
24 public File(String storage, String path) {
25 this.storage = storage;
28 protected void finalize() {
32 * Opens the file whose name is the string pointed to by path.
33 * @param storage is the name where you can find the file descriptor
34 * @param path is the file location on the storage
36 protected native void open(String storage, String path);
38 * Read elements of a file.
39 * @param size of each element
40 * @param nMemb is the number of elements of data to write
42 public native long read(long size, long nMemb);
44 * Write elements into a file.
45 * @param size of each element
46 * @param nMemb is the number of elements of data to write
48 public native long write(long size, long nMemb);
52 public native void close();
55 * Class initializer, to initialize various JNI stuff
57 public static native void nativeInit();