a static jni method takes the jclass for that method as its second argument; simplify pad() and divide(), and rename divide() to ceiling(); sketch FileInputStream.cpp and FileOutputStream.cpp

This commit is contained in:
Joel Dice
2007-07-25 18:48:28 -06:00
parent 38a982c7dd
commit 9ab88ef619
14 changed files with 233 additions and 49 deletions

View File

@ -1,15 +1,28 @@
package java.io;
public class FileInputStream extends InputStream {
private final FileDescriptor fd;
private final int fd;
public FileInputStream(FileDescriptor fd) {
this.fd = fd;
this.fd = fd.value;
}
public native int read() throws IOException;
private static native int read(int fd) throws IOException;
public native int read(byte[] b, int offset, int length) throws IOException;
private static native int read(int fd, byte[] b, int offset, int length)
throws IOException;
public native void close() throws IOException;
public static native void close(int fd) throws IOException;
public int read() throws IOException {
return read(fd);
}
public int read(byte[] b, int offset, int length) throws IOException {
return read(fd, b, offset, length);
}
public void close() throws IOException {
close(fd);
}
}