1 public class FileOutputStream extends OutputStream {
4 public FileOutputStream(String pathname) {
5 fd=nativeOpen(pathname.getBytes());
8 public FileOutputStream(String pathname, boolean append) {
10 fd=nativeAppend(pathname.getBytes());
12 fd=nativeOpen(pathname.getBytes());
15 public FileOutputStream(String pathname, int mode) {
17 fd=nativeAppend(pathname.getBytes());
19 fd=nativeOpen(pathname.getBytes());
22 public FileOutputStream(File path) {
23 fd=nativeOpen(path.getPath().getBytes());
26 public FileOutputStreamOpen(String pathname) {
27 fd = nativeOpen(pathname.getBytes());
30 private static native int nativeOpen(byte[] filename);
31 private static native int nativeAppend(byte[] filename);
32 private static native void nativeWrite(int fd, byte[] array, int off, int len);
33 private static native void nativeClose(int fd);
34 private static native void nativeFlush(int fd);
36 public void write(int ch) {
42 public void write(byte[] b) {
43 nativeWrite(fd, b, 0, b.length);