1 /*******************************************************************************
2 * Copyright (c) 2000, 2011 IBM Corporation and others.
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/
9 * SPDX-License-Identifier: EPL-2.0
12 * IBM Corporation - initial API and implementation
13 *******************************************************************************/
14 package org.eclipse.swt.internal.image;
19 final class LEDataOutputStream extends OutputStream {
21 public LEDataOutputStream(OutputStream output) {
25 * Write the specified number of bytes of the given byte array,
26 * starting at the specified offset, to the output stream.
29 public void write(byte b[], int off, int len) throws IOException {
30 out.write(b, off, len);
33 * Write the given byte to the output stream.
36 public void write(int b) throws IOException {
40 * Write the given byte to the output stream.
42 public void writeByte(byte b) throws IOException {
46 * Write the four bytes of the given integer
47 * to the output stream.
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);
56 * Write the two bytes of the given short
57 * to the output stream.
59 public void writeShort(int theShort) throws IOException {
60 out.write(theShort & 0xFF);
61 out.write((theShort >> 8) & 0xFF);