add ability to append to files

This commit is contained in:
Zsombor Gegesy
2010-08-15 03:05:18 +02:00
committed by Joel Dice
parent f0f35a920f
commit 1daa93d3c4
3 changed files with 32 additions and 4 deletions

View File

@ -22,14 +22,19 @@ public class FileOutputStream extends OutputStream {
}
public FileOutputStream(String path) throws IOException {
fd = open(path);
this(path, false);
}
public FileOutputStream(String path, boolean append) throws IOException {
fd = open(path, append);
}
public FileOutputStream(File file) throws IOException {
this(file.getPath());
}
private static native int open(String path) throws IOException;
private static native int open(String path, boolean append) throws IOException;
private static native void write(int fd, int c) throws IOException;