view dwt/dwthelper/OutputStream.d @ 330:f980ea238e72

it is possible for "this.istr" to be null before this method is called, so we should check for it before attempting to close the stream
author Craig Slusher <cslush@gmail.com>
date Mon, 26 Jan 2009 10:46:51 -0500
parents 32a6819fef61
children
line wrap: on
line source

/**
 * Authors: Frank Benoit <keinfarbton@googlemail.com>
 */
module dwt.dwthelper.OutputStream;

import dwt.dwthelper.utils;

public abstract class OutputStream {

    public this(){
    }

    public abstract void write( int b );

    public void write( byte[] b ){
        foreach( bv; b ){
            write(bv);
        }
    }

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

    public void flush(){
    }

    public void close(){
    }
}