X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=Robust%2Fsrc%2FClassLibrary%2FFileOutputStream.java;fp=Robust%2Fsrc%2FClassLibrary%2FFileOutputStream.java;h=0000000000000000000000000000000000000000;hb=cdcf09c40af1419fa42932aae249cb79b69b5daf;hp=031634ff1930e1217222795a30505880b601f7f6;hpb=2f2cbbbc9385b82d891fabf62ab7e0c5cf364658;p=IRC.git diff --git a/Robust/src/ClassLibrary/FileOutputStream.java b/Robust/src/ClassLibrary/FileOutputStream.java deleted file mode 100644 index 031634ff..00000000 --- a/Robust/src/ClassLibrary/FileOutputStream.java +++ /dev/null @@ -1,43 +0,0 @@ -public class FileOutputStream { - private int fd; - - public FileOutputStream(String pathname) { - fd=nativeOpen(pathname.getBytes()); - } - - public FileOutputStream(String pathname, int mode) { - if(mode==0) - fd=nativeAppend(pathname.getBytes()); - if(mode==1) - fd=nativeOpen(pathname.getBytes()); - } - - - public FileOutputStream(File path) { - fd=nativeOpen(path.getPath().getBytes()); - } - - private static native int nativeOpen(byte[] filename); - private static native int nativeAppend(byte[] filename); - private static native void nativeWrite(int fd, byte[] array); - private static native void nativeClose(int fd); - private static native void nativeFlush(int fd); - - public void write(int ch) { - byte b[]=new byte[1]; - b[0]=(byte)ch; - write(b); - } - - public void write(byte[] b) { - nativeWrite(fd, b); - } - - public void flush() { - nativeFlush(fd); - } - - public void close() { - nativeClose(fd); - } -}