Mercurial > projects > dwt-linux
view dwt/dwthelper/FileOutputStream.d @ 316:a2166f25ce17
update TANGOSVN
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Tue, 16 Sep 2008 15:28:32 +0200 |
parents | cc1d3de0e80b |
children | 8ebacc5c07dc |
line wrap: on
line source
/** * Authors: Frank Benoit <keinfarbton@googlemail.com> */ module dwt.dwthelper.FileOutputStream; public import dwt.dwthelper.File; public import dwt.dwthelper.OutputStream; import dwt.dwthelper.utils; version(TANGOSVN){ import tango.io.device.FileConduit; } else { import tango.io.FileConduit; } public class FileOutputStream : dwt.dwthelper.OutputStream.OutputStream { alias dwt.dwthelper.OutputStream.OutputStream.write write; alias dwt.dwthelper.OutputStream.OutputStream.close close; FileConduit fc; public this ( String name ){ fc = new FileConduit( name, FileConduit.WriteCreate ); } public this ( String name, bool append ){ fc = new FileConduit( name, append ? FileConduit.WriteAppending : FileConduit.WriteCreate ); } public this ( dwt.dwthelper.File.File file ){ this( file.toString ); } public this ( dwt.dwthelper.File.File file, bool append ){ this( file.toString, append ); } public override void write( int b ){ ubyte[1] a; a[0] = b & 0xFF; fc.write(a); } public override void close(){ fc.close(); } public void finalize(){ implMissing( __FILE__, __LINE__ ); } }