diff java/src/java/io/ByteArrayOutputStream.d @ 0:6dd524f61e62

add dwt win and basic java stuff
author Frank Benoit <benoit@tionex.de>
date Mon, 02 Mar 2009 14:44:16 +0100
parents
children 9b96950f2c3c
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/java/src/java/io/ByteArrayOutputStream.d	Mon Mar 02 14:44:16 2009 +0100
@@ -0,0 +1,73 @@
+/**
+ * Authors: Frank Benoit <keinfarbton@googlemail.com>
+ */
+module java.io.ByteArrayOutputStream;
+
+public import java.io.OutputStream;
+import java.lang.all;
+import tango.io.device.Array;
+
+public class ByteArrayOutputStream : java.io.OutputStream.OutputStream {
+
+    protected Array buffer;
+
+    public this (){
+        buffer = new Array();
+    }
+
+    public this ( int par_size ){
+        buffer = new Array(par_size);
+    }
+
+    public synchronized override void write( int b ){
+        byte[1] a;
+        a[0] = b & 0xFF;
+        buffer.append(a);
+    }
+
+    public synchronized override void write( byte[] b, int off, int len ){
+        buffer.append( b[ off .. off + len ]);
+    }
+
+    public synchronized override void write( byte[] b ){
+        buffer.append( b );
+    }
+
+    public synchronized void writeTo( java.io.OutputStream.OutputStream out_KEYWORDESCAPE ){
+        implMissing( __FILE__, __LINE__ );
+    }
+
+    public synchronized void reset(){
+        implMissing( __FILE__, __LINE__ );
+    }
+
+    public synchronized byte[] toByteArray(){
+        return cast(byte[])buffer.slice();
+    }
+
+    public int size(){
+        implMissing( __FILE__, __LINE__ );
+        return 0;
+    }
+
+    public override String toString(){
+        implMissing( __FILE__, __LINE__ );
+        return null;
+    }
+
+    public String toString( String enc ){
+        implMissing( __FILE__, __LINE__ );
+        return null;
+    }
+
+    public String toString( int hibyte ){
+        implMissing( __FILE__, __LINE__ );
+        return null;
+    }
+
+    public  override void close(){
+        implMissing( __FILE__, __LINE__ );
+    }
+}
+
+