]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.eclipse.swt.win32.win32.x86_64/src/org/eclipse/swt/internal/image/LEDataOutputStream.java
da938a0598384120689fe3d0b86c77a45bc07378
[simantics/platform.git] / bundles / org.eclipse.swt.win32.win32.x86_64 / src / org / eclipse / swt / internal / image / LEDataOutputStream.java
1 /*******************************************************************************
2  * Copyright (c) 2000, 2011 IBM Corporation and others.
3  *
4  * This program and the accompanying materials
5  * are made available under the terms of the Eclipse Public License 2.0
6  * which accompanies this distribution, and is available at
7  * https://www.eclipse.org/legal/epl-2.0/
8  *
9  * SPDX-License-Identifier: EPL-2.0
10  *
11  * Contributors:
12  *     IBM Corporation - initial API and implementation
13  *******************************************************************************/
14 package org.eclipse.swt.internal.image;
15
16
17 import java.io.*;
18
19 final class LEDataOutputStream extends OutputStream {
20         OutputStream out;
21 public LEDataOutputStream(OutputStream output) {
22         this.out = output;
23 }
24 /**
25  * Write the specified number of bytes of the given byte array,
26  * starting at the specified offset, to the output stream.
27  */
28 @Override
29 public void write(byte b[], int off, int len) throws IOException {
30         out.write(b, off, len);
31 }
32 /**
33  * Write the given byte to the output stream.
34  */
35 @Override
36 public void write(int b) throws IOException {
37         out.write(b);
38 }
39 /**
40  * Write the given byte to the output stream.
41  */
42 public void writeByte(byte b) throws IOException {
43         out.write(b & 0xFF);
44 }
45 /**
46  * Write the four bytes of the given integer
47  * to the output stream.
48  */
49 public void writeInt(int theInt) throws IOException {
50         out.write(theInt & 0xFF);
51         out.write((theInt >> 8) & 0xFF);
52         out.write((theInt >> 16) & 0xFF);
53         out.write((theInt >> 24) & 0xFF);
54 }
55 /**
56  * Write the two bytes of the given short
57  * to the output stream.
58  */
59 public void writeShort(int theShort) throws IOException {
60         out.write(theShort & 0xFF);
61         out.write((theShort >> 8) & 0xFF);
62 }
63 }