Mercurial > projects > dwt2
annotate org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/image/LEDataOutputStream.d @ 125:c43718956f21 default tip
Updated the snippets status.
author | Jacob Carlborg <doob@me.com> |
---|---|
date | Thu, 11 Aug 2011 19:55:14 +0200 |
parents | 536e43f63c81 |
children |
rev | line source |
---|---|
25 | 1 /******************************************************************************* |
2 * Copyright (c) 2000, 2005 IBM Corporation and others. | |
3 * All rights reserved. This program and the accompanying materials | |
4 * are made available under the terms of the Eclipse Public License v1.0 | |
5 * which accompanies this distribution, and is available at | |
6 * http://www.eclipse.org/legal/epl-v10.html | |
7 * | |
8 * Contributors: | |
9 * IBM Corporation - initial API and implementation | |
10 * Port to the D programming language: | |
11 * Frank Benoit <benoit@tionex.de> | |
12 *******************************************************************************/ | |
13 module org.eclipse.swt.internal.image.LEDataOutputStream; | |
14 | |
15 | |
16 import java.io.OutputStream; | |
17 | |
18 final class LEDataOutputStream : OutputStream { | |
19 | |
20 alias OutputStream.write write; | |
21 | |
22 OutputStream ostr; | |
23 | |
24 public this(OutputStream output) { | |
25 this.ostr = output; | |
26 } | |
27 /** | |
28 * Write the specified number of bytes of the given byte array, | |
29 * starting at the specified offset, to the output stream. | |
30 */ | |
120
536e43f63c81
Comprehensive update for Win32/Linux32 dmd-2.053/dmd-1.068+Tango-r5661
Denis Shelomovskij <verylonglogin.reg@gmail.com>
parents:
25
diff
changeset
|
31 public override void write(in byte b[], int off, int len) { |
25 | 32 ostr.write(b, off, len); |
33 } | |
34 /** | |
35 * Write the given byte to the output stream. | |
36 */ | |
37 public override void write(int b) { | |
38 ostr.write(b); | |
39 } | |
40 /** | |
41 * Write the given byte to the output stream. | |
42 */ | |
43 public void writeByte(byte b) { | |
44 ostr.write(b); | |
45 } | |
46 /** | |
47 * Write the four bytes of the given integer | |
48 * to the output stream. | |
49 */ | |
50 public void writeInt(int theInt) { | |
51 ostr.write(theInt & 0xFF); | |
52 ostr.write((theInt >> 8) & 0xFF); | |
53 ostr.write((theInt >> 16) & 0xFF); | |
54 ostr.write((theInt >> 24) & 0xFF); | |
55 } | |
56 /** | |
57 * Write the two bytes of the given short | |
58 * to the output stream. | |
59 */ | |
60 public void writeShort(int theShort) { | |
61 ostr.write(theShort & 0xFF); | |
62 ostr.write((theShort >> 8) & 0xFF); | |
63 } | |
64 } |