1 package org.simgrid.msg;
3 * Copyright (c) 2012-2013. The SimGrid Team.
6 * This program is free software; you can redistribute
7 * it and/or modify it under the terms of the license
8 * (GNU LGPL) which comes with this package.
13 protected String storage;
15 * Represents the bind between the java comm and the
16 * native C comm. You must never access it, since it is
19 private long bind = 0;
21 * Constructor, opens the file.
22 * @param storage is the name where you can find the file descriptor
23 * @param path is the file location on the storage
25 public File(String storage, String path) {
26 this.storage = storage;
29 protected void finalize() {
33 * Opens the file whose name is the string pointed to by path.
34 * @param storage is the name where you can find the file descriptor
35 * @param path is the file location on the storage
37 protected native void open(String storage, String path);
39 * Read elements of a file.
40 * @param size of each element
41 * @param nMemb is the number of elements of data to write
43 public native long read(long size, long nMemb);
45 * Write elements into a file.
46 * @param size of each element
47 * @param nMemb is the number of elements of data to write
49 public native long write(long size, long nMemb);
53 public native void close();
56 * Class initializer, to initialize various JNI stuff
58 public static native void nativeInit();