Mercurial > projects > dwt-win
view dwt/dwthelper/ByteArrayOutputStream.d @ 242:32a6819fef61
Fix implMissing for ImageLoader.save, thx yidabu for reporting.
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Tue, 24 Jun 2008 22:05:28 +0200 |
parents | ab60f3309436 |
children | d10ff1f47f84 |
line wrap: on
line source
/** * Authors: Frank Benoit <keinfarbton@googlemail.com> */ module dwt.dwthelper.ByteArrayOutputStream; public import dwt.dwthelper.OutputStream; import dwt.dwthelper.utils; import tango.io.GrowBuffer; public class ByteArrayOutputStream : dwt.dwthelper.OutputStream.OutputStream { protected GrowBuffer buffer; public this (){ buffer = new GrowBuffer(); } public this ( int par_size ){ buffer = new GrowBuffer(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( dwt.dwthelper.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__ ); } }