Mercurial > projects > dwt-mac
diff dwt/internal/image/LEDataOutputStream.d @ 34:5123b17c98ef
Ported dwt.events.*, dwt.graphics.GC, Region, dwt.internal.image.*
author | Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com> |
---|---|
date | Sun, 14 Sep 2008 01:45:57 +0200 |
parents | b903c16b6f48 |
children |
line wrap: on
line diff
--- a/dwt/internal/image/LEDataOutputStream.d Fri Sep 12 13:53:21 2008 +0200 +++ b/dwt/internal/image/LEDataOutputStream.d Sun Sep 14 01:45:57 2008 +0200 @@ -7,53 +7,58 @@ * * Contributors: * IBM Corporation - initial API and implementation + * Port to the D programming language: + * Frank Benoit <benoit@tionex.de> *******************************************************************************/ -module dwt.internal.image; +module dwt.internal.image.LEDataOutputStream; -import java.io.IOException; -import java.io.OutputStream; +import dwt.dwthelper.OutputStream; final class LEDataOutputStream : OutputStream { - OutputStream out; + + alias OutputStream.write write; + + OutputStream ostr; + public this(OutputStream output) { - this.out = output; + this.ostr = output; } /** * Write the specified number of bytes of the given byte array, * starting at the specified offset, to the output stream. */ -public void write(byte b[], int off, int len) { - out.write(b, off, len); +public override void write(byte b[], int off, int len) { + ostr.write(b, off, len); } /** * Write the given byte to the output stream. */ -public void write(int b) { - out.write(b); +public override void write(int b) { + ostr.write(b); } /** * Write the given byte to the output stream. */ public void writeByte(byte b) { - out.write(b & 0xFF); + ostr.write(b); } /** * Write the four bytes of the given integer * to the output stream. */ public void writeInt(int theInt) { - out.write(theInt & 0xFF); - out.write((theInt >> 8) & 0xFF); - out.write((theInt >> 16) & 0xFF); - out.write((theInt >> 24) & 0xFF); + ostr.write(theInt & 0xFF); + ostr.write((theInt >> 8) & 0xFF); + ostr.write((theInt >> 16) & 0xFF); + ostr.write((theInt >> 24) & 0xFF); } /** * Write the two bytes of the given short * to the output stream. */ public void writeShort(int theShort) { - out.write(theShort & 0xFF); - out.write((theShort >> 8) & 0xFF); + ostr.write(theShort & 0xFF); + ostr.write((theShort >> 8) & 0xFF); } }