Debian Codegraph @

plugins/org.eclipse.emf.gwt.common/src/org/eclipse/emf/emul/java/io/OutputStream.java

raw
1 /**
2 * Copyright (c) 2010 Ed Merks and others.
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Eclipse Public License v2.0
5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/epl-v20.html
7 *
8 * Contributors:
9 * Ed Merks - Initial API and implementation
10 */
11 package java.io;
12
13
14 import java.io.IOException;
15
16
17 public abstract class OutputStream
18 {
19 //public abstract void write(int byteValue) throws IOException;
20 public void write(int byteValue) throws IOException {
21 //can't be abstract because of the default GWT implementations that do not implement this method
22 throw new UnsupportedOperationException("This method body is just a replacement for an abstract method declaration");
23 }
24
25 public void write(byte[] bytes) throws IOException
26 {
27 write(bytes, 0, bytes.length);
28 }
29
30 public void write(byte[] bytes, int start, int length) throws IOException
31 {
32 for (int i = start, limit = start + length; i < limit; ++i)
33 {
34 write(bytes[i]);
35 }
36 }
37
38 public void flush() throws IOException
39 {
40 // Do nothing.
41 }
42
43 public void close() throws IOException
44 {
45 // Do nothing.
46 }
47 }