view dwt/dwthelper/OutputStream.d @ 156:969e7de37c3d default tip

Fixes to get dwt to work with dmd and ldc
author Jacob Carlborg <doob@me.com>
date Wed, 08 Jul 2009 21:56:44 +0200
parents db5a898b2119
children
line wrap: on
line source

/**
 * Authors: Frank Benoit <keinfarbton@googlemail.com>
 *          Jacob Carlborg <jacob.carlborg@gmail.com>
 */
module dwt.dwthelper.OutputStream;

import dwt.dwthelper.utils;
static import tango.io.model.IConduit;

public abstract class OutputStream {

    protected tango.io.model.IConduit.OutputStream ostr;

    public this(){
    }

    protected this( tango.io.model.IConduit.OutputStream aOutStream) {
        this.ostr = aOutStream;
    }

    protected this(OutputStream rhs) {
        ostr = rhs.ostr;
    }

    public abstract void write( int b );

    public void write( byte[] b ){
        ostr.write(b);
    }

    public void write(char[] c) {
        ostr.write(c);
    }

    public void write( byte[] b, int off, int len ){
        ostr.write(b[off .. off + len]);
    }

    public void flush(){
        ostr.flush();
    }

    public void close(){
        ostr.flush();
        implMissing( __FILE__, __LINE__ );
    }


}