Revert "Adds emulation for some Java IO classes."
Externalization will not be supported in the foreseeable future.
A smaller alternative patch will be submitted to handle the cases
where there is shared code that uses Externalizable.
This reverts commit b3c64a7a62f69a90820b61a77b93056f20d623c9.
Change-Id: Ib1df0f1ff7d8fc002552d72348ebc01e9aa39df2
diff --git a/user/super/com/google/gwt/emul/java/io/DataInput.java b/user/super/com/google/gwt/emul/java/io/DataInput.java
deleted file mode 100644
index 5250b77..0000000
--- a/user/super/com/google/gwt/emul/java/io/DataInput.java
+++ /dev/null
@@ -1,243 +0,0 @@
-// CHECKSTYLE_OFF: Copyrighted to the Android Open Source Project.
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-// CHECKSTYLE_ON
-
-package java.io;
-
-/**
- * Defines an interface for classes that are able to read big-endian typed data from some
- * source. Typically, this data has been written by a class which implements
- * {@link DataOutput}. Types that can be read include byte, 16-bit short, 32-bit
- * int, 32-bit float, 64-bit long, 64-bit double, byte strings, and MUTF-8
- * strings.
- *
- * <h3>MUTF-8 (Modified UTF-8) Encoding</h3>
- * <p>
- * When encoding strings as UTF, implementations of {@code DataInput} and
- * {@code DataOutput} use a slightly modified form of UTF-8, hereafter referred
- * to as MUTF-8. This form is identical to standard UTF-8, except:
- * <ul>
- * <li>Only the one-, two-, and three-byte encodings are used.</li>
- * <li>Code points in the range <code>U+10000</code> …
- * <code>U+10ffff</code> are encoded as a surrogate pair, each of which is
- * represented as a three-byte encoded value.</li>
- * <li>The code point <code>U+0000</code> is encoded in two-byte form.</li>
- * </ul>
- * <p>
- * Please refer to <a href="http://unicode.org">The Unicode Standard</a> for
- * further information about character encoding. MUTF-8 is actually closer to
- * the (relatively less well-known) encoding <a
- * href="http://www.unicode.org/reports/tr26/">CESU-8</a> than to UTF-8 per se.
- *
- * @see DataInputStream
- * @see RandomAccessFile
- */
-public interface DataInput {
- /**
- * Reads a boolean.
- *
- * @return the next boolean value.
- * @throws EOFException if the end of the input is reached before the read
- * request can be satisfied.
- * @throws IOException
- * if an I/O error occurs while reading.
- * @see DataOutput#writeBoolean(boolean)
- */
- boolean readBoolean() throws IOException;
-
- /**
- * Reads an 8-bit byte value.
- *
- * @return the next byte value.
- * @throws EOFException if the end of the input is reached before the read
- * request can be satisfied.
- * @throws IOException
- * if an I/O error occurs while reading.
- * @see DataOutput#writeByte(int)
- */
- byte readByte() throws IOException;
-
- /**
- * Reads a big-endian 16-bit character value.
- *
- * @return the next char value.
- * @throws EOFException if the end of the input is reached before the read
- * request can be satisfied.
- * @throws IOException
- * if an I/O error occurs while reading.
- * @see DataOutput#writeChar(int)
- */
- char readChar() throws IOException;
-
- /**
- * Reads a big-endian 64-bit double value.
- *
- * @return the next double value.
- * @throws EOFException if the end of the input is reached before the read
- * request can be satisfied.
- * @throws IOException
- * if an I/O error occurs while reading.
- * @see DataOutput#writeDouble(double)
- */
- double readDouble() throws IOException;
-
- /**
- * Reads a big-endian 32-bit float value.
- *
- * @return the next float value.
- * @throws EOFException if the end of the input is reached before the read
- * request can be satisfied.
- * @throws IOException
- * if an I/O error occurs while reading.
- * @see DataOutput#writeFloat(float)
- */
- float readFloat() throws IOException;
-
- /**
- * Equivalent to {@code readFully(dst, 0, dst.length);}.
- */
- void readFully(byte[] dst) throws IOException;
-
- /**
- * Reads {@code byteCount} bytes from this stream and stores them in the byte
- * array {@code dst} starting at {@code offset}. If {@code byteCount} is zero, then this
- * method returns without reading any bytes. Otherwise, this method blocks until
- * {@code byteCount} bytes have been read. If insufficient bytes are available,
- * {@code EOFException} is thrown. If an I/O error occurs, {@code IOException} is
- * thrown. When an exception is thrown, some bytes may have been consumed from the stream
- * and written into the array.
- *
- * @param dst
- * the byte array into which the data is read.
- * @param offset
- * the offset in {@code dst} at which to store the bytes.
- * @param byteCount
- * the number of bytes to read.
- * @throws EOFException
- * if the end of the source stream is reached before enough
- * bytes have been read.
- * @throws IndexOutOfBoundsException
- * if {@code offset < 0} or {@code byteCount < 0}, or
- * {@code offset + byteCount > dst.length}.
- * @throws IOException
- * if a problem occurs while reading from this stream.
- * @throws NullPointerException
- * if {@code dst} is null.
- */
- void readFully(byte[] dst, int offset, int byteCount) throws IOException;
-
- /**
- * Reads a big-endian 32-bit integer value.
- *
- * @return the next int value.
- * @throws EOFException if the end of the input is reached before the read
- * request can be satisfied.
- * @throws IOException
- * if an I/O error occurs while reading.
- * @see DataOutput#writeInt(int)
- */
- int readInt() throws IOException;
-
- /**
- * Returns a string containing the next line of text available from this
- * stream. A line is made of zero or more characters followed by {@code
- * '\n'}, {@code '\r'}, {@code "\r\n"} or the end of the stream. The string
- * does not include the newline sequence.
- *
- * @return the contents of the line or null if no characters have been read
- * before the end of the stream.
- * @throws EOFException if the end of the input is reached before the read
- * request can be satisfied.
- * @throws IOException
- * if an I/O error occurs while reading.
- */
- String readLine() throws IOException;
-
- /**
- * Reads a big-endian 64-bit long value.
- *
- * @return the next long value.
- * @throws EOFException if the end of the input is reached before the read
- * request can be satisfied.
- * @throws IOException
- * if an I/O error occurs while reading.
- * @see DataOutput#writeLong(long)
- */
- long readLong() throws IOException;
-
- /**
- * Reads a big-endian 16-bit short value.
- *
- * @return the next short value.
- * @throws EOFException if the end of the input is reached before the read
- * request can be satisfied.
- * @throws IOException
- * if an I/O error occurs while reading.
- * @see DataOutput#writeShort(int)
- */
- short readShort() throws IOException;
-
- /**
- * Reads an unsigned 8-bit byte value and returns it as an int.
- *
- * @return the next unsigned byte value.
- * @throws EOFException if the end of the input is reached before the read
- * request can be satisfied.
- * @throws IOException
- * if an I/O error occurs while reading.
- * @see DataOutput#writeByte(int)
- */
- int readUnsignedByte() throws IOException;
-
- /**
- * Reads a big-endian 16-bit unsigned short value and returns it as an int.
- *
- * @return the next unsigned short value.
- * @throws EOFException if the end of the input is reached before the read
- * request can be satisfied.
- * @throws IOException
- * if an I/O error occurs while reading.
- * @see DataOutput#writeShort(int)
- */
- int readUnsignedShort() throws IOException;
-
- /**
- * Reads a string encoded with {@link DataInput modified UTF-8}.
- *
- * @return the next string encoded with {@link DataInput modified UTF-8}.
- * @throws EOFException if the end of the input is reached before the read
- * request can be satisfied.
- * @throws IOException
- * if an I/O error occurs while reading.
- * @see DataOutput#writeUTF(java.lang.String)
- */
- String readUTF() throws IOException;
-
- /**
- * Skips {@code count} number of bytes. This method will not throw an
- * {@link EOFException} if the end of the input is reached before
- * {@code count} bytes where skipped.
- *
- * @param count
- * the number of bytes to skip.
- * @return the number of bytes actually skipped.
- * @throws IOException
- * if a problem occurs during skipping.
- */
- int skipBytes(int count) throws IOException;
-}
\ No newline at end of file
diff --git a/user/super/com/google/gwt/emul/java/io/DataOutput.java b/user/super/com/google/gwt/emul/java/io/DataOutput.java
deleted file mode 100644
index 0c000f5..0000000
--- a/user/super/com/google/gwt/emul/java/io/DataOutput.java
+++ /dev/null
@@ -1,166 +0,0 @@
-// CHECKSTYLE_OFF: Copyrighted to the Android Open Source Project.
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-// CHECKSTYLE_ON
-
-package java.io;
-
-/**
- * Defines an interface for classes that are able to write big-endian typed data to some
- * target. Typically, this data can be read in by a class which implements
- * DataInput. Types that can be written include byte, 16-bit short, 32-bit int,
- * 32-bit float, 64-bit long, 64-bit double, byte strings, and {@link DataInput
- * MUTF-8} encoded strings.
- *
- * @see DataOutputStream
- * @see RandomAccessFile
- */
-public interface DataOutput {
-
- /**
- * Writes the entire contents of the byte array {@code buffer} to this
- * stream.
- *
- * @param buffer the buffer to write.
- * @throws IOException if an I/O error occurs while writing.
- */
- void write(byte[] buffer) throws IOException;
-
- /**
- * Writes {@code count} bytes from the byte array {@code buffer} starting at
- * offset {@code index}.
- *
- * @param buffer the buffer to write.
- * @param offset the index of the first byte in {@code buffer} to write.
- * @param count the number of bytes from the {@code buffer} to write.
- * @throws IOException if an I/O error occurs while writing.
- */
- void write(byte[] buffer, int offset, int count) throws IOException;
-
- /**
- * Writes the specified 8-bit byte.
- *
- * @param oneByte the byte to write.
- * @throws IOException if an I/O error occurs while writing.
- * @see DataInput#readByte()
- */
- void write(int oneByte) throws IOException;
-
- /**
- * Writes the specified boolean.
- *
- * @param val the boolean value to write.
- * @throws IOException if an I/O error occurs while writing.
- * @see DataInput#readBoolean()
- */
- void writeBoolean(boolean val) throws IOException;
-
- /**
- * Writes the specified 8-bit byte.
- *
- * @param val the byte value to write.
- * @throws IOException if an I/O error occurs while writing.
- * @see DataInput#readByte()
- * @see DataInput#readUnsignedByte()
- */
- void writeByte(int val) throws IOException;
-
- /**
- * Writes the low order 8-bit bytes from the specified string.
- *
- * @param str the string containing the bytes to write.
- * @throws IOException if an I/O error occurs while writing.
- */
- void writeBytes(String str) throws IOException;
-
- /**
- * Writes the specified 16-bit character in big-endian order. Only the two least significant
- * bytes of the integer {@code oneByte} are written.
- *
- * @param val the character to write.
- * @throws IOException if an I/O error occurs while writing.
- * @see DataInput#readChar()
- */
- void writeChar(int val) throws IOException;
-
- /**
- * Writes the 16-bit characters contained in {@code str} in big-endian order.
- *
- * @param str the string that contains the characters to write.
- * @throws IOException if an I/O error occurs while writing.
- * @see DataInput#readChar()
- */
- void writeChars(String str) throws IOException;
-
- /**
- * Writes the specified 64-bit double in big-endian order. The resulting output is the eight
- * bytes returned by {@link Double#doubleToLongBits(double)}.
- *
- * @param val the double to write.
- * @throws IOException if an I/O error occurs while writing.
- * @see DataInput#readDouble()
- */
- void writeDouble(double val) throws IOException;
-
- /**
- * Writes the specified 32-bit float in big-endian order. The resulting output is the four bytes
- * returned by {@link Float#floatToIntBits(float)}.
- *
- * @param val the float to write.
- * @throws IOException if an I/O error occurs while writing.
- * @see DataInput#readFloat()
- */
- void writeFloat(float val) throws IOException;
-
- /**
- * Writes the specified 32-bit int in big-endian order.
- *
- * @param val the int to write.
- * @throws IOException if an I/O error occurs while writing.
- * @see DataInput#readInt()
- */
- void writeInt(int val) throws IOException;
-
- /**
- * Writes the specified 64-bit long in big-endian order.
- *
- * @param val the long to write.
- * @throws IOException if an I/O error occurs while writing.
- * @see DataInput#readLong()
- */
- void writeLong(long val) throws IOException;
-
- /**
- * Writes the specified 16-bit short in big-endian order. Only the lower two bytes of {@code
- * val} are written.
- *
- * @param val the short to write.
- * @throws IOException if an I/O error occurs while writing.
- * @see DataInput#readShort()
- * @see DataInput#readUnsignedShort()
- */
- void writeShort(int val) throws IOException;
-
- /**
- * Writes the specified string encoded in {@link DataInput modified UTF-8}.
- *
- * @param str the string to write encoded in {@link DataInput modified UTF-8}.
- * @throws IOException if an I/O error occurs while writing.
- * @see DataInput#readUTF()
- */
- void writeUTF(String str) throws IOException;
-}
\ No newline at end of file
diff --git a/user/super/com/google/gwt/emul/java/io/Externalizable.java b/user/super/com/google/gwt/emul/java/io/Externalizable.java
deleted file mode 100644
index 4d1c17a..0000000
--- a/user/super/com/google/gwt/emul/java/io/Externalizable.java
+++ /dev/null
@@ -1,49 +0,0 @@
-// CHECKSTYLE_OFF: Copyrighted to the Android Open Source Project.
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-// CHECKSTYLE_ON
-
-package java.io;
-
-/**
- * Defines an interface for classes that want to be serializable, but have their
- * own binary representation.
- */
-public interface Externalizable extends Serializable {
- /**
- * Reads the next object from the ObjectInput <code>input</code>.
- *
- * @param input
- * the ObjectInput from which the next object is read.
- * @throws IOException
- * if an error occurs attempting to read from {@code input}.
- * @throws ClassNotFoundException
- * if the class of the instance being loaded cannot be found.
- */
- void readExternal(ObjectInput input) throws IOException,
- ClassNotFoundException;
-
- /**
- * Writes the receiver to the ObjectOutput <code>output</code>.
- *
- * @param output
- * the ObjectOutput to write the object to.
- * @throws IOException
- * if an error occurs attempting to write to {@code output}.
- */
- void writeExternal(ObjectOutput output) throws IOException;
-}
\ No newline at end of file
diff --git a/user/super/com/google/gwt/emul/java/io/ObjectInput.java b/user/super/com/google/gwt/emul/java/io/ObjectInput.java
deleted file mode 100644
index b2dfeb8..0000000
--- a/user/super/com/google/gwt/emul/java/io/ObjectInput.java
+++ /dev/null
@@ -1,113 +0,0 @@
-// CHECKSTYLE_OFF: Copyrighted to the Android Open Source Project.
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-// CHECKSTYLE_ON
-
-package java.io;
-
-/**
- * Defines an interface for classes that allow reading serialized objects.
- *
- * @see ObjectInputStream
- * @see ObjectOutput
- */
-public interface ObjectInput extends DataInput, AutoCloseable {
- /**
- * Indicates the number of bytes of primitive data that can be read without
- * blocking.
- *
- * @return the number of bytes available.
- * @throws IOException
- * if an I/O error occurs.
- */
- int available() throws IOException;
-
- /**
- * Closes this stream. Implementations of this method should free any
- * resources used by the stream.
- *
- * @throws IOException
- * if an I/O error occurs while closing the input stream.
- */
- void close() throws IOException;
-
- /**
- * Reads a single byte from this stream and returns it as an integer in the
- * range from 0 to 255. Returns -1 if the end of this stream has been
- * reached. Blocks if no input is available.
- *
- * @return the byte read or -1 if the end of this stream has been reached.
- * @throws IOException
- * if this stream is closed or another I/O error occurs.
- */
- int read() throws IOException;
-
- /**
- * Reads bytes from this stream into the byte array {@code buffer}. Blocks
- * while waiting for input.
- *
- * @param buffer
- * the array in which to store the bytes read.
- * @return the number of bytes read or -1 if the end of this stream has been
- * reached.
- * @throws IOException
- * if this stream is closed or another I/O error occurs.
- */
- int read(byte[] buffer) throws IOException;
-
- /**
- * Reads at most {@code count} bytes from this stream and stores them in
- * byte array {@code buffer} starting at offset {@code count}. Blocks while
- * waiting for input.
- *
- * @param buffer
- * the array in which to store the bytes read.
- * @param offset
- * the initial position in {@code buffer} to store the bytes read
- * from this stream.
- * @param count
- * the maximum number of bytes to store in {@code buffer}.
- * @return the number of bytes read or -1 if the end of this stream has been
- * reached.
- * @throws IOException
- * if this stream is closed or another I/O error occurs.
- */
- int read(byte[] buffer, int offset, int count) throws IOException;
-
- /**
- * Reads the next object from this stream.
- *
- * @return the object read.
- *
- * @throws ClassNotFoundException
- * if the object's class cannot be found.
- * @throws IOException
- * if this stream is closed or another I/O error occurs.
- */
- Object readObject() throws ClassNotFoundException, IOException;
-
- /**
- * Skips {@code byteCount} bytes on this stream. Less than {@code byteCount} byte are
- * skipped if the end of this stream is reached before the operation
- * completes.
- *
- * @return the number of bytes actually skipped.
- * @throws IOException
- * if this stream is closed or another I/O error occurs.
- */
- long skip(long byteCount) throws IOException;
-}
\ No newline at end of file
diff --git a/user/super/com/google/gwt/emul/java/io/ObjectOutput.java b/user/super/com/google/gwt/emul/java/io/ObjectOutput.java
deleted file mode 100644
index 4eae0cf..0000000
--- a/user/super/com/google/gwt/emul/java/io/ObjectOutput.java
+++ /dev/null
@@ -1,96 +0,0 @@
-// CHECKSTYLE_OFF: Copyrighted to the Android Open Source Project.
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-// CHECKSTYLE_ON
-
-package java.io;
-
-/**
- * Defines an interface for classes that allow reading serialized objects.
- *
- * @see ObjectOutputStream
- * @see ObjectInput
- */
-public interface ObjectOutput extends DataOutput, AutoCloseable {
- /**
- * Closes the target stream. Implementations of this method should free any
- * resources used by the stream.
- *
- * @throws IOException
- * if an error occurs while closing the target stream.
- */
- void close() throws IOException;
-
- /**
- * Flushes the target stream. Implementations of this method should ensure
- * that any pending writes are written out to the target stream.
- *
- * @throws IOException
- * if an error occurs while flushing the target stream.
- */
- void flush() throws IOException;
-
- /**
- * Writes the entire contents of the byte array {@code buffer} to the output
- * stream. Blocks until all bytes are written.
- *
- * @param buffer
- * the buffer to write.
- * @throws IOException
- * if an error occurs while writing to the target stream.
- */
- void write(byte[] buffer) throws IOException;
-
- /**
- * Writes {@code count} bytes from the byte array {@code buffer} starting at
- * position {@code offset} to the target stream. Blocks until all bytes are
- * written.
- *
- * @param buffer
- * the buffer to write.
- * @param offset
- * the index of the first byte in {@code buffer} to write.
- * @param count
- * the number of bytes from {@code buffer} to write to the target
- * stream.
- * @throws IOException
- * if an error occurs while writing to the target stream.
- */
- void write(byte[] buffer, int offset, int count) throws IOException;
-
- /**
- * Writes a single byte to the target stream. Only the least significant
- * byte of the integer {@code value} is written to the stream. Blocks until
- * the byte is actually written.
- *
- * @param value
- * the byte to write.
- * @throws IOException
- * if an error occurs while writing to the target stream.
- */
- void write(int value) throws IOException;
-
- /**
- * Writes the specified object {@code obj} to the target stream.
- *
- * @param obj
- * the object to write.
- * @throws IOException
- * if an error occurs while writing to the target stream.
- */
- void writeObject(Object obj) throws IOException;
-}
\ No newline at end of file