Mercurial > projects > dwt2
comparison 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 |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:6dd524f61e62 |
---|---|
1 /** | |
2 * Authors: Frank Benoit <keinfarbton@googlemail.com> | |
3 */ | |
4 module java.io.ByteArrayOutputStream; | |
5 | |
6 public import java.io.OutputStream; | |
7 import java.lang.all; | |
8 import tango.io.device.Array; | |
9 | |
10 public class ByteArrayOutputStream : java.io.OutputStream.OutputStream { | |
11 | |
12 protected Array buffer; | |
13 | |
14 public this (){ | |
15 buffer = new Array(); | |
16 } | |
17 | |
18 public this ( int par_size ){ | |
19 buffer = new Array(par_size); | |
20 } | |
21 | |
22 public synchronized override void write( int b ){ | |
23 byte[1] a; | |
24 a[0] = b & 0xFF; | |
25 buffer.append(a); | |
26 } | |
27 | |
28 public synchronized override void write( byte[] b, int off, int len ){ | |
29 buffer.append( b[ off .. off + len ]); | |
30 } | |
31 | |
32 public synchronized override void write( byte[] b ){ | |
33 buffer.append( b ); | |
34 } | |
35 | |
36 public synchronized void writeTo( java.io.OutputStream.OutputStream out_KEYWORDESCAPE ){ | |
37 implMissing( __FILE__, __LINE__ ); | |
38 } | |
39 | |
40 public synchronized void reset(){ | |
41 implMissing( __FILE__, __LINE__ ); | |
42 } | |
43 | |
44 public synchronized byte[] toByteArray(){ | |
45 return cast(byte[])buffer.slice(); | |
46 } | |
47 | |
48 public int size(){ | |
49 implMissing( __FILE__, __LINE__ ); | |
50 return 0; | |
51 } | |
52 | |
53 public override String toString(){ | |
54 implMissing( __FILE__, __LINE__ ); | |
55 return null; | |
56 } | |
57 | |
58 public String toString( String enc ){ | |
59 implMissing( __FILE__, __LINE__ ); | |
60 return null; | |
61 } | |
62 | |
63 public String toString( int hibyte ){ | |
64 implMissing( __FILE__, __LINE__ ); | |
65 return null; | |
66 } | |
67 | |
68 public override void close(){ | |
69 implMissing( __FILE__, __LINE__ ); | |
70 } | |
71 } | |
72 | |
73 |