comparison dwt/internal/image/LEDataOutputStream.d @ 0:380af2bdd8e5

Upload of whole dwt tree
author Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
date Sat, 09 Aug 2008 17:00:02 +0200
parents
children 1a8b3cb347e0
comparison
equal deleted inserted replaced
-1:000000000000 0:380af2bdd8e5
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 *******************************************************************************/
11 module dwt.internal.image;
12
13
14 import java.io.IOException;
15 import java.io.OutputStream;
16
17 final class LEDataOutputStream : OutputStream {
18 OutputStream out;
19 public LEDataOutputStream(OutputStream output) {
20 this.out = output;
21 }
22 /**
23 * Write the specified number of bytes of the given byte array,
24 * starting at the specified offset, to the output stream.
25 */
26 public void write(byte b[], int off, int len) throws IOException {
27 out.write(b, off, len);
28 }
29 /**
30 * Write the given byte to the output stream.
31 */
32 public void write(int b) throws IOException {
33 out.write(b);
34 }
35 /**
36 * Write the given byte to the output stream.
37 */
38 public void writeByte(byte b) throws IOException {
39 out.write(b & 0xFF);
40 }
41 /**
42 * Write the four bytes of the given integer
43 * to the output stream.
44 */
45 public void writeInt(int theInt) throws IOException {
46 out.write(theInt & 0xFF);
47 out.write((theInt >> 8) & 0xFF);
48 out.write((theInt >> 16) & 0xFF);
49 out.write((theInt >> 24) & 0xFF);
50 }
51 /**
52 * Write the two bytes of the given short
53 * to the output stream.
54 */
55 public void writeShort(int theShort) throws IOException {
56 out.write(theShort & 0xFF);
57 out.write((theShort >> 8) & 0xFF);
58 }
59 }