harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From telli...@apache.org
Subject svn commit: r492652 [2/13] - /harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/
Date Thu, 04 Jan 2007 17:47:05 GMT
Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/CharArrayWriter.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/CharArrayWriter.java?view=diff&rev=492652&r1=492651&r2=492652
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/CharArrayWriter.java (original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/CharArrayWriter.java Thu Jan  4 09:47:01 2007
@@ -19,297 +19,287 @@
 
 import org.apache.harmony.luni.util.Msg;
 
-
 /**
  * CharArrayWriter is used as a character output stream on a character array.
  * The buffer used to store the written characters will grow as needed to
  * accommodate more characters as they are written.
- * 
  */
 public class CharArrayWriter extends Writer {
-	
-	/**
-	 * Buffer for characters
-	 */
-	protected char[] buf;
-
-	/**
-	 * The ending index of the buffer.
-	 */
-	protected int count;
-
-	/**
-	 * Constructs a new CharArrayWriter which has a buffer allocated with the
-	 * default size of 32 characters. The buffer is also the <code>lock</code>
-	 * used to synchronize access to this Writer.
-	 * 
-	 */
-	public CharArrayWriter() {
-		super();
-		buf = new char[32];
-		lock = buf;
-	}
-
-	/**
-	 * Constructs a new CharArrayWriter which has a buffer allocated with the
-	 * size of <code>initialSize</code> characters. The buffer is also the
-	 * <code>lock</code> used to synchronize access to this Writer.
-	 * 
-	 * @param initialSize
-	 *            the initial size of this CharArrayWriters buffer.
-	 */
-	public CharArrayWriter(int initialSize) {
-		super();
-		if (initialSize >= 0) {
-			buf = new char[initialSize];
-			lock = buf;
-		} else {
+
+    /**
+     * Buffer for characters
+     */
+    protected char[] buf;
+
+    /**
+     * The ending index of the buffer.
+     */
+    protected int count;
+
+    /**
+     * Constructs a new CharArrayWriter which has a buffer allocated with the
+     * default size of 32 characters. The buffer is also the <code>lock</code>
+     * used to synchronize access to this Writer.
+     */
+    public CharArrayWriter() {
+        super();
+        buf = new char[32];
+        lock = buf;
+    }
+
+    /**
+     * Constructs a new CharArrayWriter which has a buffer allocated with the
+     * size of <code>initialSize</code> characters. The buffer is also the
+     * <code>lock</code> used to synchronize access to this Writer.
+     * 
+     * @param initialSize
+     *            the initial size of this CharArrayWriters buffer.
+     */
+    public CharArrayWriter(int initialSize) {
+        super();
+        if (initialSize < 0) {
             throw new IllegalArgumentException(Msg.getString("K005e")); //$NON-NLS-1$
         }
-	}
-
-	/**
-	 * Close this Writer. This is the concrete implementation required. This
-	 * particular implementation does nothing.
-	 * 
-	 */
-	@Override
+        buf = new char[initialSize];
+        lock = buf;
+    }
+
+    /**
+     * Close this Writer. This is the concrete implementation required. This
+     * particular implementation does nothing.
+     */
+    @Override
     public void close() {
-		/* empty */
-	}
+        /* empty */
+    }
 
-	private void expand(int i) {
-		/* Can the buffer handle @i more chars, if not expand it */
-		if (count + i <= buf.length) {
+    private void expand(int i) {
+        /* Can the buffer handle @i more chars, if not expand it */
+        if (count + i <= buf.length) {
             return;
         }
 
-		char[] newbuf = new char[buf.length + (2 * i)];
-		System.arraycopy(buf, 0, newbuf, 0, count);
-		buf = newbuf;
-	}
-
-	/**
-	 * Flush this Writer. This is the concrete implementation required. This
-	 * particular implementation does nothing.
-	 * 
-	 */
-
-	@Override
+        char[] newbuf = new char[buf.length + (2 * i)];
+        System.arraycopy(buf, 0, newbuf, 0, count);
+        buf = newbuf;
+    }
+
+    /**
+     * Flush this Writer. This is the concrete implementation required. This
+     * particular implementation does nothing.
+     */
+    @Override
     public void flush() {
-		/* empty */
-	}
+        /* empty */
+    }
+
+    /**
+     * Reset this Writer. The current write position is reset to the beginning
+     * of the buffer. All written characters are lost and the size of this
+     * writer is now 0.
+     */
+    public void reset() {
+        synchronized (lock) {
+            count = 0;
+        }
+    }
 
-	/**
-	 * Reset this Writer. The current write position is reset to the beginning
-	 * of the buffer. All written characters are lost and the size of this
-	 * writer is now 0.
-	 * 
-	 */
-	public void reset() {
-		synchronized (lock) {
-			count = 0;
-		}
-	}
-
-	/**
-	 * Answer the size of this Writer in characters. This number changes if this
-	 * Writer is reset or as more characters are written to it.
-	 * 
-	 * @return int this CharArrayWriters current size in characters.
-	 */
-	public int size() {
-		synchronized (lock) {
-			return count;
-		}
-	}
-
-	/**
-	 * Answer the contents of the receiver as a char array. The array returned
-	 * is a copy and any modifications made to this Writer after are not
-	 * reflected in the result.
-	 * 
-	 * @return char[] this CharArrayWriters contents as a new char array.
-	 */
-	public char[] toCharArray() {
-		synchronized (lock) {
-			char[] result = new char[count];
-			System.arraycopy(buf, 0, result, 0, count);
-			return result;
-		}
-	}
-
-	/**
-	 * Answer the contents of this CharArrayWriter as a String. The String
-	 * returned is a copy and any modifications made to this Writer after are
-	 * not reflected in the result.
-	 * 
-	 * @return String this CharArrayWriters contents as a new String.
-	 */
-	@Override
+    /**
+     * Answer the size of this Writer in characters. This number changes if this
+     * Writer is reset or as more characters are written to it.
+     * 
+     * @return int this CharArrayWriters current size in characters.
+     */
+    public int size() {
+        synchronized (lock) {
+            return count;
+        }
+    }
+
+    /**
+     * Answer the contents of the receiver as a char array. The array returned
+     * is a copy and any modifications made to this Writer after are not
+     * reflected in the result.
+     * 
+     * @return char[] this CharArrayWriters contents as a new char array.
+     */
+    public char[] toCharArray() {
+        synchronized (lock) {
+            char[] result = new char[count];
+            System.arraycopy(buf, 0, result, 0, count);
+            return result;
+        }
+    }
+
+    /**
+     * Answer the contents of this CharArrayWriter as a String. The String
+     * returned is a copy and any modifications made to this Writer after are
+     * not reflected in the result.
+     * 
+     * @return String this CharArrayWriters contents as a new String.
+     */
+    @Override
     public String toString() {
-		synchronized (lock) {
-			return new String(buf, 0, count);
-		}
-	}
-
-	/**
-	 * Writes <code>count</code> characters starting at <code>offset</code>
-	 * in <code>buf</code> to this CharArrayWriter.
-	 * 
-	 * @param c
-	 *            the non-null array containing characters to write.
-	 * @param offset
-	 *            offset in buf to retrieve characters
-	 * @param len
-	 *            maximum number of characters to write
-	 */
-	@Override
+        synchronized (lock) {
+            return new String(buf, 0, count);
+        }
+    }
+
+    /**
+     * Writes <code>count</code> characters starting at <code>offset</code>
+     * in <code>buf</code> to this CharArrayWriter.
+     * 
+     * @param c
+     *            the non-null array containing characters to write.
+     * @param offset
+     *            offset in buf to retrieve characters
+     * @param len
+     *            maximum number of characters to write
+     */
+    @Override
     public void write(char[] c, int offset, int len) {
-		// avoid int overflow
-		if (0 <= offset && offset <= c.length && 0 <= len
-				&& len <= c.length - offset) {
-			synchronized (lock) {
-				expand(len);
-				System.arraycopy(c, offset, this.buf, this.count, len);
-				this.count += len;
-			}
-		} else {
+        // avoid int overflow
+        if (offset < 0 || offset > c.length || len < 0
+                || len > c.length - offset) {
             throw new IndexOutOfBoundsException();
         }
-	}
+        synchronized (lock) {
+            expand(len);
+            System.arraycopy(c, offset, this.buf, this.count, len);
+            this.count += len;
+        }
+    }
 
-	/**
-	 * Writes the specified character <code>oneChar</code> to this
-	 * CharArrayWriter. This implementation writes the low order two bytes to
-	 * the Stream.
-	 * 
-	 * @param oneChar
-	 *            The character to write
-	 */
-	@Override
+    /**
+     * Writes the specified character <code>oneChar</code> to this
+     * CharArrayWriter. This implementation writes the low order two bytes to
+     * the Stream.
+     * 
+     * @param oneChar
+     *            The character to write
+     */
+    @Override
     public void write(int oneChar) {
-		synchronized (lock) {
-			expand(1);
-			buf[count++] = (char) oneChar;
-		}
-	}
-
-	/**
-	 * Writes <code>count</code> number of characters starting at
-	 * <code>offset</code> from the String <code>str</code> to this
-	 * CharArrayWriter.
-	 * 
-	 * @param str
-	 *            the non-null String containing the characters to write.
-	 * @param offset
-	 *            the starting point to retrieve characters.
-	 * @param len
-	 *            the number of characters to retrieve and write.
-	 */
-	@Override
+        synchronized (lock) {
+            expand(1);
+            buf[count++] = (char) oneChar;
+        }
+    }
+
+    /**
+     * Writes <code>count</code> number of characters starting at
+     * <code>offset</code> from the String <code>str</code> to this
+     * CharArrayWriter.
+     * 
+     * @param str
+     *            the non-null String containing the characters to write.
+     * @param offset
+     *            the starting point to retrieve characters.
+     * @param len
+     *            the number of characters to retrieve and write.
+     */
+    @Override
     public void write(String str, int offset, int len) {
         if (str == null) {
             throw new NullPointerException(Msg.getString("K0047")); //$NON-NLS-1$
         }
-		// avoid int overflow
-		if (0 <= offset && offset <= str.length() && 0 <= len
-				&& len <= str.length() - offset) {
-			synchronized (lock) {
-				expand(len);
-				str.getChars(offset, offset + len, buf, this.count);
-				this.count += len;
-			}
-		} else {
+        // avoid int overflow
+        if (offset < 0 || offset > str.length() || len < 0
+                || len > str.length() - offset) {
             throw new StringIndexOutOfBoundsException();
         }
-	}
+        synchronized (lock) {
+            expand(len);
+            str.getChars(offset, offset + len, buf, this.count);
+            this.count += len;
+        }
+    }
 
-	/**
-	 * Writes the contents of this CharArrayWriter to another Writer. The output
-	 * is all the characters that have been written to the receiver since the
-	 * last reset or since the creation.
-	 * 
-	 * @param out
-	 *            the non-null Writer on which to write the contents.
-	 * 
-	 * @throws IOException
-	 *             If an error occurs attempting to write the contents out.
-	 */
-	public void writeTo(Writer out) throws IOException {
-		synchronized (lock) {
-			out.write(buf, 0, count);
-		}
-	}
-    
-	/**
-	 * Append a char <code>c</code>to the CharArrayWriter. The
-	 * CharArrayWriter.append(<code>c</code>) works the same way as
-	 * CharArrayWriter.write(<code>c</code>).
-	 * 
-	 * @override Writer.append
-	 * @param c
-	 *            The character appended to the CharArrayWriter.
-	 * @return The CharArrayWriter.
-	 */
-	@Override
+    /**
+     * Writes the contents of this CharArrayWriter to another Writer. The output
+     * is all the characters that have been written to the receiver since the
+     * last reset or since the creation.
+     * 
+     * @param out
+     *            the non-null Writer on which to write the contents.
+     * 
+     * @throws IOException
+     *             If an error occurs attempting to write the contents out.
+     */
+    public void writeTo(Writer out) throws IOException {
+        synchronized (lock) {
+            out.write(buf, 0, count);
+        }
+    }
+
+    /**
+     * Append a char <code>c</code>to the CharArrayWriter. The
+     * CharArrayWriter.append(<code>c</code>) works the same way as
+     * CharArrayWriter.write(<code>c</code>).
+     * 
+     * @override Writer.append
+     * @param c
+     *            The character appended to the CharArrayWriter.
+     * @return The CharArrayWriter.
+     */
+    @Override
     public CharArrayWriter append(char c) {
-	    write(c);
-	    return this;
-	}
-
-	/**
-	 * Append a CharSequence <code>csq</code> to the CharArrayWriter. The
-	 * CharArrayWriter.append(<code>csq</code>) works the same way as
-	 * CharArrayWriter.write(<code>csq</code>.toString()). If
-	 * <code>csq</code> is null, then then "null" will be substituted for
-	 * <code>csq</code>.
-	 * 
-	 * @override Writer.append
-	 * @param csq
-	 *            The CharSequence appended to the CharArrayWriter.
-	 * @return The CharArrayWriter
-	 */
-	@Override
+        write(c);
+        return this;
+    }
+
+    /**
+     * Append a CharSequence <code>csq</code> to the CharArrayWriter. The
+     * CharArrayWriter.append(<code>csq</code>) works the same way as
+     * CharArrayWriter.write(<code>csq</code>.toString()). If
+     * <code>csq</code> is null, then then "null" will be substituted for
+     * <code>csq</code>.
+     * 
+     * @override Writer.append
+     * @param csq
+     *            The CharSequence appended to the CharArrayWriter.
+     * @return The CharArrayWriter
+     */
+    @Override
     public CharArrayWriter append(CharSequence csq) {
-	    if (null == csq) {
-	        append(TOKEN_NULL, 0, TOKEN_NULL.length());
-	    } else {
-	        append(csq, 0, csq.length());
-	    }
-	    return this;
-	}
-
-	/**
-	 * Append a subsequence of a CharSequence <code>csq</code> to the
-	 * CharArrayWriter. The first char and the last char of the subsequnce is
-	 * specified by the parameter <code>start</code> and <code>end</code>.
-	 * The CharArrayWriter.append(<code>csq</code>) works the same way as
-	 * CharArrayWriter.write(<code>csq</code>.subSequence(<code>start</code>,<code>end</code>).toString).
-	 * If <code>csq</code> is null, then "null" will be substituted for
-	 * <code>csq</code>.
-	 * 
-	 * @override Writer.append
-	 * @param csq
-	 *            The CharSequence appended to the CharArrayWriter.
-	 * @param start
-	 *            The index of the first char in the CharSequence appended to
-	 *            the CharArrayWriter.
-	 * @param end
-	 *            The index of the char after the last one in the CharSequence
-	 *            appended to the CharArrayWriter.
-	 * @return The CharArrayWriter.
-	 * @throws IndexOutOfBoundsException
-	 *             If start is less than end, end is greater than the length of
-	 *             the CharSequence, or start or end is negative.
-	 */
-	@Override
+        if (null == csq) {
+            append(TOKEN_NULL, 0, TOKEN_NULL.length());
+        } else {
+            append(csq, 0, csq.length());
+        }
+        return this;
+    }
+
+    /**
+     * Append a subsequence of a CharSequence <code>csq</code> to the
+     * CharArrayWriter. The first char and the last char of the subsequnce is
+     * specified by the parameter <code>start</code> and <code>end</code>.
+     * The CharArrayWriter.append(<code>csq</code>) works the same way as
+     * CharArrayWriter.write(<code>csq</code>.subSequence(<code>start</code>,<code>end</code>).toString).
+     * If <code>csq</code> is null, then "null" will be substituted for
+     * <code>csq</code>.
+     * 
+     * @override Writer.append
+     * @param csq
+     *            The CharSequence appended to the CharArrayWriter.
+     * @param start
+     *            The index of the first char in the CharSequence appended to
+     *            the CharArrayWriter.
+     * @param end
+     *            The index of the char after the last one in the CharSequence
+     *            appended to the CharArrayWriter.
+     * @return The CharArrayWriter.
+     * @throws IndexOutOfBoundsException
+     *             If start is less than end, end is greater than the length of
+     *             the CharSequence, or start or end is negative.
+     */
+    @Override
     public CharArrayWriter append(CharSequence csq, int start, int end) {
-	    if (null == csq) {
-	        csq = TOKEN_NULL;
-	    }
-	    String output = csq.subSequence(start, end).toString();
-	    write(output, 0, output.length());
-	    return this;
-	}
+        if (null == csq) {
+            csq = TOKEN_NULL;
+        }
+        String output = csq.subSequence(start, end).toString();
+        write(output, 0, output.length());
+        return this;
+    }
 }

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/CharConversionException.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/CharConversionException.java?view=diff&rev=492652&r1=492651&r2=492652
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/CharConversionException.java (original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/CharConversionException.java Thu Jan  4 09:47:01 2007
@@ -17,32 +17,29 @@
 
 package java.io;
 
-
 /**
  * This is the top level class for character conversion exceptions.
- * 
  */
 public class CharConversionException extends IOException {
 
     private static final long serialVersionUID = -8680016352018427031L;
-    
-	/**
-	 * Constructs a new instance of this class with its walkback filled in.
-	 * 
-	 */
-	public CharConversionException() {
-		super();
-	}
 
-	/**
-	 * Constructs a new instance of this class with its walkback and message
-	 * filled in.
-	 * 
-	 * @param detailMessage
-	 *            The detail message for the exception.
-	 */
-	public CharConversionException(String detailMessage) {
-		super(detailMessage);
-	}
+    /**
+     * Constructs a new instance of this class with its walkback filled in.
+     * 
+     */
+    public CharConversionException() {
+        super();
+    }
 
+    /**
+     * Constructs a new instance of this class with its walkback and message
+     * filled in.
+     * 
+     * @param detailMessage
+     *            The detail message for the exception.
+     */
+    public CharConversionException(String detailMessage) {
+        super(detailMessage);
+    }
 }

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/Closeable.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/Closeable.java?view=diff&rev=492652&r1=492651&r2=492652
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/Closeable.java (original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/Closeable.java Thu Jan  4 09:47:01 2007
@@ -21,13 +21,13 @@
  * called its close method to release resources it holds.
  */
 public interface Closeable {
-	
-	/**
-	 * Close the object and release any system resources it holds. If the object
-	 * has been close, then invoke this method has no effect.
-	 * 
-	 * @throws IOException
-	 *             if any error raises when closing the object.
-	 */
-	public void close() throws IOException;
+
+    /**
+     * Close the object and release any system resources it holds. If the object
+     * has been close, then invoke this method has no effect.
+     * 
+     * @throws IOException
+     *             if any error raises when closing the object.
+     */
+    public void close() throws IOException;
 }

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/DataInput.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/DataInput.java?view=diff&rev=492652&r1=492651&r2=492652
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/DataInput.java (original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/DataInput.java Thu Jan  4 09:47:01 2007
@@ -17,7 +17,6 @@
 
 package java.io;
 
-
 /**
  * DataInput is an interface which declares methods for reading in typed data
  * from a Stream. Typically, this stream has been written by a class which
@@ -29,204 +28,204 @@
  * @see RandomAccessFile
  */
 public interface DataInput {
-	/**
-	 * Reads a boolean from this stream.
-	 * 
-	 * @return the next boolean value from the source stream.
-	 * 
-	 * @throws IOException
-	 *             If a problem occurs reading from this stream.
-	 * 
-	 * @see DataOutput#writeBoolean(boolean)
-	 */
-	public abstract boolean readBoolean() throws IOException;
-
-	/**
-	 * Reads an 8-bit byte value from this stream.
-	 * 
-	 * @return the next byte value from the source stream.
-	 * 
-	 * @throws IOException
-	 *             If a problem occurs reading from this stream.
-	 * 
-	 * @see DataOutput#writeByte(int)
-	 */
-	public abstract byte readByte() throws IOException;
-
-	/**
-	 * Reads a 16-bit character value from this stream.
-	 * 
-	 * @return the next <code>char</code> value from the source stream.
-	 * 
-	 * @throws IOException
-	 *             If a problem occurs reading from this stream.
-	 * 
-	 * @see DataOutput#writeChar(int)
-	 */
-	public abstract char readChar() throws IOException;
-
-	/**
-	 * Reads a 64-bit <code>double</code> value from this stream.
-	 * 
-	 * @return the next <code>double</code> value from the source stream.
-	 * 
-	 * @throws IOException
-	 *             If a problem occurs reading from this stream.
-	 * 
-	 * @see DataOutput#writeDouble(double)
-	 */
-	public abstract double readDouble() throws IOException;
-
-	/**
-	 * Reads a 32-bit <code>float</code> value from this stream.
-	 * 
-	 * @return the next <code>float</code> value from the source stream.
-	 * 
-	 * @throws IOException
-	 *             If a problem occurs reading from this stream.
-	 * 
-	 * @see DataOutput#writeFloat(float)
-	 */
-	public abstract float readFloat() throws IOException;
-
-	/**
-	 * Reads bytes from this stream into the byte array <code>buffer</code>.
-	 * This method will block until <code>buffer.length</code> number of bytes
-	 * have been read.
-	 * 
-	 * @param buffer
-	 *            the buffer to read bytes into
-	 * 
-	 * @throws IOException
-	 *             If a problem occurs reading from this stream.
-	 * 
-	 * @see DataOutput#write(byte[])
-	 * @see DataOutput#write(byte[], int, int)
-	 */
-	public abstract void readFully(byte[] buffer) throws IOException;
-
-	/**
-	 * Read bytes from this stream and stores them in byte array
-	 * <code>buffer</code> starting at offset <code>offset</code>. This
-	 * method blocks until <code>count</code> number of bytes have been read.
-	 * 
-	 * @param buffer
-	 *            the byte array in which to store the read bytes.
-	 * @param offset
-	 *            the offset in <code>buffer</code> to store the read bytes.
-	 * @param count
-	 *            the maximum number of bytes to store in <code>buffer</code>.
-	 * 
-	 * @throws IOException
-	 *             If a problem occurs reading from this stream.
-	 * 
-	 * @see DataOutput#write(byte[])
-	 * @see DataOutput#write(byte[], int, int)
-	 */
-	public abstract void readFully(byte[] buffer, int offset, int count)
-			throws IOException;
-
-	/**
-	 * Reads a 32-bit integer value from this stream.
-	 * 
-	 * @return the next <code>int</code> value from the source stream.
-	 * 
-	 * @throws IOException
-	 *             If a problem occurs reading from this stream.
-	 * 
-	 * @see DataOutput#writeInt(int)
-	 */
-	public abstract int readInt() throws IOException;
-
-	/**
-	 * Answers a <code>String</code> representing the next line of text
-	 * available in this BufferedReader. A line is represented by 0 or more
-	 * characters followed by <code>'\n'</code>, <code>'\r'</code>,
-	 * <code>"\n\r"</code> or end of stream. The <code>String</code> does
-	 * not include the newline sequence.
-	 * 
-	 * @return the contents of the line or null if no characters were read
-	 *         before end of stream.
-	 * 
-	 * @throws IOException
-	 *             If a problem occurs reading from this stream.
-	 */
-	public abstract String readLine() throws IOException;
-
-	/**
-	 * Reads a 64-bit <code>long</code> value from this stream.
-	 * 
-	 * @return the next <code>long</code> value from the source stream.
-	 * 
-	 * @throws IOException
-	 *             If a problem occurs reading from this stream.
-	 * 
-	 * @see DataOutput#writeLong(long)
-	 */
-	public abstract long readLong() throws IOException;
-
-	/**
-	 * Reads a 16-bit <code>short</code> value from this stream.
-	 * 
-	 * @return the next <code>short</code> value from the source stream.
-	 * 
-	 * @throws IOException
-	 *             If a problem occurs reading from this stream.
-	 * 
-	 * @see DataOutput#writeShort(int)
-	 */
-	public abstract short readShort() throws IOException;
-
-	/**
-	 * Reads an unsigned 8-bit <code>byte</code> value from this stream and
-	 * returns it as an int.
-	 * 
-	 * @return the next unsigned byte value from the source stream.
-	 * 
-	 * @throws IOException
-	 *             If a problem occurs reading from this stream.
-	 * 
-	 * @see DataOutput#writeByte(int)
-	 */
-	public abstract int readUnsignedByte() throws IOException;
-
-	/**
-	 * Reads a 16-bit unsigned <code>short</code> value from this stream and
-	 * returns it as an int.
-	 * 
-	 * @return the next unsigned <code>short</code> value from the source
-	 *         stream.
-	 * 
-	 * @throws IOException
-	 *             If a problem occurs reading from this stream.
-	 * 
-	 * @see DataOutput#writeShort(int)
-	 */
-	public abstract int readUnsignedShort() throws IOException;
-
-	/**
-	 * Reads a UTF format String from this Stream.
-	 * 
+    /**
+     * Reads a boolean from this stream.
+     * 
+     * @return the next boolean value from the source stream.
+     * 
+     * @throws IOException
+     *             If a problem occurs reading from this stream.
+     * 
+     * @see DataOutput#writeBoolean(boolean)
+     */
+    public abstract boolean readBoolean() throws IOException;
+
+    /**
+     * Reads an 8-bit byte value from this stream.
+     * 
+     * @return the next byte value from the source stream.
+     * 
+     * @throws IOException
+     *             If a problem occurs reading from this stream.
+     * 
+     * @see DataOutput#writeByte(int)
+     */
+    public abstract byte readByte() throws IOException;
+
+    /**
+     * Reads a 16-bit character value from this stream.
+     * 
+     * @return the next <code>char</code> value from the source stream.
+     * 
+     * @throws IOException
+     *             If a problem occurs reading from this stream.
+     * 
+     * @see DataOutput#writeChar(int)
+     */
+    public abstract char readChar() throws IOException;
+
+    /**
+     * Reads a 64-bit <code>double</code> value from this stream.
+     * 
+     * @return the next <code>double</code> value from the source stream.
+     * 
+     * @throws IOException
+     *             If a problem occurs reading from this stream.
+     * 
+     * @see DataOutput#writeDouble(double)
+     */
+    public abstract double readDouble() throws IOException;
+
+    /**
+     * Reads a 32-bit <code>float</code> value from this stream.
+     * 
+     * @return the next <code>float</code> value from the source stream.
+     * 
+     * @throws IOException
+     *             If a problem occurs reading from this stream.
+     * 
+     * @see DataOutput#writeFloat(float)
+     */
+    public abstract float readFloat() throws IOException;
+
+    /**
+     * Reads bytes from this stream into the byte array <code>buffer</code>.
+     * This method will block until <code>buffer.length</code> number of bytes
+     * have been read.
+     * 
+     * @param buffer
+     *            the buffer to read bytes into
+     * 
+     * @throws IOException
+     *             If a problem occurs reading from this stream.
+     * 
+     * @see DataOutput#write(byte[])
+     * @see DataOutput#write(byte[], int, int)
+     */
+    public abstract void readFully(byte[] buffer) throws IOException;
+
+    /**
+     * Read bytes from this stream and stores them in byte array
+     * <code>buffer</code> starting at offset <code>offset</code>. This
+     * method blocks until <code>count</code> number of bytes have been read.
+     * 
+     * @param buffer
+     *            the byte array in which to store the read bytes.
+     * @param offset
+     *            the offset in <code>buffer</code> to store the read bytes.
+     * @param count
+     *            the maximum number of bytes to store in <code>buffer</code>.
+     * 
+     * @throws IOException
+     *             If a problem occurs reading from this stream.
+     * 
+     * @see DataOutput#write(byte[])
+     * @see DataOutput#write(byte[], int, int)
+     */
+    public abstract void readFully(byte[] buffer, int offset, int count)
+            throws IOException;
+
+    /**
+     * Reads a 32-bit integer value from this stream.
+     * 
+     * @return the next <code>int</code> value from the source stream.
+     * 
+     * @throws IOException
+     *             If a problem occurs reading from this stream.
+     * 
+     * @see DataOutput#writeInt(int)
+     */
+    public abstract int readInt() throws IOException;
+
+    /**
+     * Answers a <code>String</code> representing the next line of text
+     * available in this BufferedReader. A line is represented by 0 or more
+     * characters followed by <code>'\n'</code>, <code>'\r'</code>,
+     * <code>"\n\r"</code> or end of stream. The <code>String</code> does
+     * not include the newline sequence.
+     * 
+     * @return the contents of the line or null if no characters were read
+     *         before end of stream.
+     * 
+     * @throws IOException
+     *             If a problem occurs reading from this stream.
+     */
+    public abstract String readLine() throws IOException;
+
+    /**
+     * Reads a 64-bit <code>long</code> value from this stream.
+     * 
+     * @return the next <code>long</code> value from the source stream.
+     * 
+     * @throws IOException
+     *             If a problem occurs reading from this stream.
+     * 
+     * @see DataOutput#writeLong(long)
+     */
+    public abstract long readLong() throws IOException;
+
+    /**
+     * Reads a 16-bit <code>short</code> value from this stream.
+     * 
+     * @return the next <code>short</code> value from the source stream.
+     * 
+     * @throws IOException
+     *             If a problem occurs reading from this stream.
+     * 
+     * @see DataOutput#writeShort(int)
+     */
+    public abstract short readShort() throws IOException;
+
+    /**
+     * Reads an unsigned 8-bit <code>byte</code> value from this stream and
+     * returns it as an int.
+     * 
+     * @return the next unsigned byte value from the source stream.
+     * 
+     * @throws IOException
+     *             If a problem occurs reading from this stream.
+     * 
+     * @see DataOutput#writeByte(int)
+     */
+    public abstract int readUnsignedByte() throws IOException;
+
+    /**
+     * Reads a 16-bit unsigned <code>short</code> value from this stream and
+     * returns it as an int.
+     * 
+     * @return the next unsigned <code>short</code> value from the source
+     *         stream.
+     * 
+     * @throws IOException
+     *             If a problem occurs reading from this stream.
+     * 
+     * @see DataOutput#writeShort(int)
+     */
+    public abstract int readUnsignedShort() throws IOException;
+
+    /**
+     * Reads a UTF format String from this Stream.
+     * 
      * @return the next UTF String from the source stream.
-	 * 
-	 * @throws IOException
-	 *             If a problem occurs reading from this stream.
-	 * 
-	 * @see DataOutput#writeUTF(java.lang.String)
-	 */
-	public abstract String readUTF() throws IOException;
-
-	/**
-	 * Skips <code>count</code> number of bytes in this stream. Subsequent
-	 * <code>read()</code>'s will not return these bytes unless
-	 * <code>reset()</code> is used.
-	 * 
-	 * @param count
-	 *            the number of bytes to skip.
-	 * @return the number of bytes actually skipped.
-	 * 
-	 * @throws IOException
-	 *             If a problem occurs reading from this stream.
-	 */
-	public abstract int skipBytes(int count) throws IOException;
+     * 
+     * @throws IOException
+     *             If a problem occurs reading from this stream.
+     * 
+     * @see DataOutput#writeUTF(java.lang.String)
+     */
+    public abstract String readUTF() throws IOException;
+
+    /**
+     * Skips <code>count</code> number of bytes in this stream. Subsequent
+     * <code>read()</code>'s will not return these bytes unless
+     * <code>reset()</code> is used.
+     * 
+     * @param count
+     *            the number of bytes to skip.
+     * @return the number of bytes actually skipped.
+     * 
+     * @throws IOException
+     *             If a problem occurs reading from this stream.
+     */
+    public abstract int skipBytes(int count) throws IOException;
 }

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/DataInputStream.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/DataInputStream.java?view=diff&rev=492652&r1=492651&r2=492652
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/DataInputStream.java (original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/DataInputStream.java Thu Jan  4 09:47:01 2007
@@ -29,167 +29,167 @@
  * @see DataOutputStream
  */
 public class DataInputStream extends FilterInputStream implements DataInput {
-	/**
-	 * Constructs a new DataInputStream on the InputStream <code>in</code>.
-	 * All reads can now be filtered through this stream. Note that data read by
-	 * this Stream is not in a human readable format and was most likely created
-	 * by a DataOutputStream.
-	 * 
-	 * @param in
-	 *            the target InputStream to filter reads on.
-	 * 
-	 * @see DataOutputStream
-	 * @see RandomAccessFile
-	 */
-	public DataInputStream(InputStream in) {
-		super(in);
-	}
-
-	/**
-	 * Reads bytes from the source stream into the byte array
-	 * <code>buffer</code>. The number of bytes actually read is returned.
-	 * 
-	 * @param buffer
-	 *            the buffer to read bytes into
-	 * @return the number of bytes actually read or -1 if end of stream.
-	 * 
-	 * @throws IOException
-	 *             If a problem occurs reading from this DataInputStream.
-	 * 
-	 * @see DataOutput#write(byte[])
-	 * @see DataOutput#write(byte[], int, int)
-	 */
-	@Override
+    /**
+     * Constructs a new DataInputStream on the InputStream <code>in</code>.
+     * All reads can now be filtered through this stream. Note that data read by
+     * this Stream is not in a human readable format and was most likely created
+     * by a DataOutputStream.
+     * 
+     * @param in
+     *            the target InputStream to filter reads on.
+     * 
+     * @see DataOutputStream
+     * @see RandomAccessFile
+     */
+    public DataInputStream(InputStream in) {
+        super(in);
+    }
+
+    /**
+     * Reads bytes from the source stream into the byte array
+     * <code>buffer</code>. The number of bytes actually read is returned.
+     * 
+     * @param buffer
+     *            the buffer to read bytes into
+     * @return the number of bytes actually read or -1 if end of stream.
+     * 
+     * @throws IOException
+     *             If a problem occurs reading from this DataInputStream.
+     * 
+     * @see DataOutput#write(byte[])
+     * @see DataOutput#write(byte[], int, int)
+     */
+    @Override
     public final int read(byte[] buffer) throws IOException {
-		return in.read(buffer, 0, buffer.length);
-	}
+        return in.read(buffer, 0, buffer.length);
+    }
 
-	/**
-	 * Read at most <code>length</code> bytes from this DataInputStream and
-	 * stores them in byte array <code>buffer</code> starting at
-	 * <code>offset</code>. Answer the number of bytes actually read or -1 if
-	 * no bytes were read and end of stream was encountered.
-	 * 
-	 * @param buffer
-	 *            the byte array in which to store the read bytes.
-	 * @param offset
-	 *            the offset in <code>buffer</code> to store the read bytes.
-	 * @param length
-	 *            the maximum number of bytes to store in <code>buffer</code>.
-	 * @return the number of bytes actually read or -1 if end of stream.
-	 * 
-	 * @throws IOException
-	 *             If a problem occurs reading from this DataInputStream.
-	 * 
-	 * @see DataOutput#write(byte[])
-	 * @see DataOutput#write(byte[], int, int)
-	 */
-	@Override
+    /**
+     * Read at most <code>length</code> bytes from this DataInputStream and
+     * stores them in byte array <code>buffer</code> starting at
+     * <code>offset</code>. Answer the number of bytes actually read or -1 if
+     * no bytes were read and end of stream was encountered.
+     * 
+     * @param buffer
+     *            the byte array in which to store the read bytes.
+     * @param offset
+     *            the offset in <code>buffer</code> to store the read bytes.
+     * @param length
+     *            the maximum number of bytes to store in <code>buffer</code>.
+     * @return the number of bytes actually read or -1 if end of stream.
+     * 
+     * @throws IOException
+     *             If a problem occurs reading from this DataInputStream.
+     * 
+     * @see DataOutput#write(byte[])
+     * @see DataOutput#write(byte[], int, int)
+     */
+    @Override
     public final int read(byte[] buffer, int offset, int length)
-			throws IOException {
-		return in.read(buffer, offset, length);
-	}
-
-	/**
-	 * Reads a boolean from this stream.
-	 * 
-	 * @return the next boolean value from the source stream.
-	 * 
-	 * @throws IOException
-	 *             If a problem occurs reading from this DataInputStream.
-	 * 
-	 * @see DataOutput#writeBoolean(boolean)
-	 */
-	public final boolean readBoolean() throws IOException {
-		int temp = in.read();
-		if (temp >= 0) {
-            return temp != 0;
-        }
-		throw new EOFException();
-	}
-
-	/**
-	 * Reads an 8-bit byte value from this stream.
-	 * 
-	 * @return the next byte value from the source stream.
-	 * 
-	 * @throws IOException
-	 *             If a problem occurs reading from this DataInputStream.
-	 * 
-	 * @see DataOutput#writeByte(int)
-	 */
-	public final byte readByte() throws IOException {
-		int temp = in.read();
-		if (temp >= 0) {
-            return (byte) temp;
-        }
-		throw new EOFException();
-	}
-
-	/**
-	 * Reads a 16-bit character value from this stream.
-	 * 
-	 * @return the next <code>char</code> value from the source stream.
-	 * 
-	 * @throws IOException
-	 *             If a problem occurs reading from this DataInputStream.
-	 * 
-	 * @see DataOutput#writeChar(int)
-	 */
-	public final char readChar() throws IOException {
-		int b1 = in.read();
-		int b2 = in.read();
-		if ((b1 | b2) >= 0) {
-            return (char) ((b1 << 8) + b2);
-        }
-		throw new EOFException();
-	}
-
-	/**
-	 * Reads a 64-bit <code>double</code> value from this stream.
-	 * 
-	 * @return the next <code>double</code> value from the source stream.
-	 * 
-	 * @throws IOException
-	 *             If a problem occurs reading from this DataInputStream.
-	 * 
-	 * @see DataOutput#writeDouble(double)
-	 */
-	public final double readDouble() throws IOException {
-		return Double.longBitsToDouble(readLong());
-	}
-
-	/**
-	 * Reads a 32-bit <code>float</code> value from this stream.
-	 * 
-	 * @return the next <code>float</code> value from the source stream.
-	 * 
-	 * @throws IOException
-	 *             If a problem occurs reading from this DataInputStream.
-	 * 
-	 * @see DataOutput#writeFloat(float)
-	 */
-	public final float readFloat() throws IOException {
-		return Float.intBitsToFloat(readInt());
-	}
-
-	/**
-	 * Reads bytes from this stream into the byte array <code>buffer</code>.
-	 * This method will block until <code>buffer.length</code> number of bytes
-	 * have been read.
-	 * 
-	 * @param buffer
-	 *            to read bytes into
-	 * 
-	 * @throws IOException
-	 *             If a problem occurs reading from this DataInputStream.
-	 * 
-	 * @see DataOutput#write(byte[])
-	 * @see DataOutput#write(byte[], int, int)
-	 */
-	public final void readFully(byte[] buffer) throws IOException {
-		readFully(buffer, 0, buffer.length);
-	}
+            throws IOException {
+        return in.read(buffer, offset, length);
+    }
+
+    /**
+     * Reads a boolean from this stream.
+     * 
+     * @return the next boolean value from the source stream.
+     * 
+     * @throws IOException
+     *             If a problem occurs reading from this DataInputStream.
+     * 
+     * @see DataOutput#writeBoolean(boolean)
+     */
+    public final boolean readBoolean() throws IOException {
+        int temp = in.read();
+        if (temp < 0) {
+            throw new EOFException();
+        }
+        return temp != 0;
+    }
+
+    /**
+     * Reads an 8-bit byte value from this stream.
+     * 
+     * @return the next byte value from the source stream.
+     * 
+     * @throws IOException
+     *             If a problem occurs reading from this DataInputStream.
+     * 
+     * @see DataOutput#writeByte(int)
+     */
+    public final byte readByte() throws IOException {
+        int temp = in.read();
+        if (temp < 0) {
+            throw new EOFException();
+        }
+        return (byte) temp;
+    }
+
+    /**
+     * Reads a 16-bit character value from this stream.
+     * 
+     * @return the next <code>char</code> value from the source stream.
+     * 
+     * @throws IOException
+     *             If a problem occurs reading from this DataInputStream.
+     * 
+     * @see DataOutput#writeChar(int)
+     */
+    public final char readChar() throws IOException {
+        int b1 = in.read();
+        int b2 = in.read();
+        if ((b1 | b2) < 0) {
+            throw new EOFException();
+        }
+        return (char) ((b1 << 8) + b2);
+    }
+
+    /**
+     * Reads a 64-bit <code>double</code> value from this stream.
+     * 
+     * @return the next <code>double</code> value from the source stream.
+     * 
+     * @throws IOException
+     *             If a problem occurs reading from this DataInputStream.
+     * 
+     * @see DataOutput#writeDouble(double)
+     */
+    public final double readDouble() throws IOException {
+        return Double.longBitsToDouble(readLong());
+    }
+
+    /**
+     * Reads a 32-bit <code>float</code> value from this stream.
+     * 
+     * @return the next <code>float</code> value from the source stream.
+     * 
+     * @throws IOException
+     *             If a problem occurs reading from this DataInputStream.
+     * 
+     * @see DataOutput#writeFloat(float)
+     */
+    public final float readFloat() throws IOException {
+        return Float.intBitsToFloat(readInt());
+    }
+
+    /**
+     * Reads bytes from this stream into the byte array <code>buffer</code>.
+     * This method will block until <code>buffer.length</code> number of bytes
+     * have been read.
+     * 
+     * @param buffer
+     *            to read bytes into
+     * 
+     * @throws IOException
+     *             If a problem occurs reading from this DataInputStream.
+     * 
+     * @see DataOutput#write(byte[])
+     * @see DataOutput#write(byte[], int, int)
+     */
+    public final void readFully(byte[] buffer) throws IOException {
+        readFully(buffer, 0, buffer.length);
+    }
 
     /**
      * Reads bytes from this stream and stores them in the byte array
@@ -229,285 +229,285 @@
         }
         while (length > 0) {
             int result = in.read(buffer, offset, length);
-            if (result >= 0) {
-                offset += result;
-                length -= result;
-            } else {
+            if (result < 0) {
                 throw new EOFException();
             }
+            offset += result;
+            length -= result;
         }
     }
 
-	/**
-	 * Reads a 32-bit integer value from this stream.
-	 * 
-	 * @return the next <code>int</code> value from the source stream.
-	 * 
-	 * @throws IOException
-	 *             If a problem occurs reading from this DataInputStream.
-	 * 
-	 * @see DataOutput#writeInt(int)
-	 */
-	public final int readInt() throws IOException {
-		int b1 = in.read();
-		int b2 = in.read();
-		int b3 = in.read();
-		int b4 = in.read();
-		if ((b1 | b2 | b3 | b4) >= 0) {
-            return ((b1 << 24) + (b2 << 16) + (b3 << 8) + b4);
-        }
-		throw new EOFException();
-	}
-
-	/**
-	 * Answers a <code>String</code> representing the next line of text
-	 * available in this BufferedReader. A line is represented by 0 or more
-	 * characters followed by <code>'\n'</code>, <code>'\r'</code>,
-	 * <code>"\n\r"</code> or end of stream. The <code>String</code> does
-	 * not include the newline sequence.
-	 * 
-	 * @return the contents of the line or null if no characters were read
-	 *         before end of stream.
-	 * 
-	 * @throws IOException
-	 *             If the DataInputStream is already closed or some other IO
-	 *             error occurs.
-	 * 
-	 * @deprecated Use BufferedReader
-	 */
-	@Deprecated
+    /**
+     * Reads a 32-bit integer value from this stream.
+     * 
+     * @return the next <code>int</code> value from the source stream.
+     * 
+     * @throws IOException
+     *             If a problem occurs reading from this DataInputStream.
+     * 
+     * @see DataOutput#writeInt(int)
+     */
+    public final int readInt() throws IOException {
+        int b1 = in.read();
+        int b2 = in.read();
+        int b3 = in.read();
+        int b4 = in.read();
+        if ((b1 | b2 | b3 | b4) < 0) {
+            throw new EOFException();
+        }
+        return ((b1 << 24) + (b2 << 16) + (b3 << 8) + b4);
+    }
+
+    /**
+     * Answers a <code>String</code> representing the next line of text
+     * available in this BufferedReader. A line is represented by 0 or more
+     * characters followed by <code>'\n'</code>, <code>'\r'</code>,
+     * <code>"\n\r"</code> or end of stream. The <code>String</code> does
+     * not include the newline sequence.
+     * 
+     * @return the contents of the line or null if no characters were read
+     *         before end of stream.
+     * 
+     * @throws IOException
+     *             If the DataInputStream is already closed or some other IO
+     *             error occurs.
+     * 
+     * @deprecated Use BufferedReader
+     */
+    @Deprecated
     public final String readLine() throws IOException {
-		StringBuffer line = new StringBuffer(80); // Typical line length
-		boolean foundTerminator = false;
-		while (true) {
-			int nextByte = in.read();
-			switch (nextByte) {
-			case -1:
-				if (line.length() == 0 && !foundTerminator) {
-                    return null;
-                }
-				return line.toString();
-			case (byte) '\r':
-				if (foundTerminator) {
-					((PushbackInputStream) in).unread(nextByte);
-					return line.toString();
-				}
-				foundTerminator = true;
-				/* Have to be able to peek ahead one byte */
-				if (!(in.getClass() == PushbackInputStream.class)) {
-                    in = new PushbackInputStream(in);
+        StringBuffer line = new StringBuffer(80); // Typical line length
+        boolean foundTerminator = false;
+        while (true) {
+            int nextByte = in.read();
+            switch (nextByte) {
+                case -1:
+                    if (line.length() == 0 && !foundTerminator) {
+                        return null;
+                    }
+                    return line.toString();
+                case (byte) '\r':
+                    if (foundTerminator) {
+                        ((PushbackInputStream) in).unread(nextByte);
+                        return line.toString();
+                    }
+                    foundTerminator = true;
+                    /* Have to be able to peek ahead one byte */
+                    if (!(in.getClass() == PushbackInputStream.class)) {
+                        in = new PushbackInputStream(in);
+                    }
+                    break;
+                case (byte) '\n':
+                    return line.toString();
+                default:
+                    if (foundTerminator) {
+                        ((PushbackInputStream) in).unread(nextByte);
+                        return line.toString();
+                    }
+                    line.append((char) nextByte);
+            }
+        }
+    }
+
+    /**
+     * Reads a 64-bit <code>long</code> value from this stream.
+     * 
+     * @return the next <code>long</code> value from the source stream.
+     * 
+     * @throws IOException
+     *             If a problem occurs reading from this DataInputStream.
+     * 
+     * @see DataOutput#writeLong(long)
+     */
+    public final long readLong() throws IOException {
+        int i1 = readInt();
+        int b1 = in.read();
+        int b2 = in.read();
+        int b3 = in.read();
+        int b4 = in.read();
+        if ((b1 | b2 | b3 | b4) < 0) {
+            throw new EOFException();
+        }
+        return (((long) i1) << 32) + ((long) b1 << 24) + (b2 << 16) + (b3 << 8)
+                + b4;
+    }
+
+    /**
+     * Reads a 16-bit <code>short</code> value from this stream.
+     * 
+     * @return the next <code>short</code> value from the source stream.
+     * 
+     * @throws IOException
+     *             If a problem occurs reading from this DataInputStream.
+     * 
+     * @see DataOutput#writeShort(int)
+     */
+    public final short readShort() throws IOException {
+        int b1 = in.read();
+        int b2 = in.read();
+        if ((b1 | b2) < 0) {
+            throw new EOFException();
+        }
+        return (short) ((b1 << 8) + b2);
+    }
+
+    /**
+     * Reads an unsigned 8-bit <code>byte</code> value from this stream and
+     * returns it as an int.
+     * 
+     * @return the next unsigned byte value from the source stream.
+     * 
+     * @throws IOException
+     *             If a problem occurs reading from this DataInputStream.
+     * 
+     * @see DataOutput#writeByte(int)
+     */
+    public final int readUnsignedByte() throws IOException {
+        int temp = in.read();
+        if (temp < 0) {
+            throw new EOFException();
+        }
+        return temp;
+    }
+
+    /**
+     * Reads a 16-bit unsigned <code>short</code> value from this stream and
+     * returns it as an int.
+     * 
+     * @return the next unsigned <code>short</code> value from the source
+     *         stream.
+     * 
+     * @throws IOException
+     *             If a problem occurs reading from this DataInputStream.
+     * 
+     * @see DataOutput#writeShort(int)
+     */
+    public final int readUnsignedShort() throws IOException {
+        int b1 = in.read();
+        int b2 = in.read();
+        if ((b1 | b2) < 0) {
+            throw new EOFException();
+        }
+        return ((b1 << 8) + b2);
+    }
+
+    /**
+     * Reads a UTF format String from this Stream.
+     * 
+     * @return the next UTF String from the source stream.
+     * 
+     * @throws IOException
+     *             If a problem occurs reading from this DataInputStream.
+     * 
+     * @see DataOutput#writeUTF(java.lang.String)
+     */
+    public final String readUTF() throws IOException {
+        int utfSize = readUnsignedShort();
+        return decodeUTF(utfSize);
+    }
+
+    static final int MAX_BUF_SIZE = 8192;
+
+    private static class CacheLock {
+    }
+
+    static final Object cacheLock = new CacheLock();
+
+    static boolean useShared = true;
+
+    static byte[] byteBuf = new byte[0];
+
+    static char[] charBuf = new char[0];
+
+    String decodeUTF(int utfSize) throws IOException {
+        byte[] buf;
+        char[] out = null;
+        boolean makeBuf = true;
+
+        /*
+         * Try to avoid the synchronization -- if we get a stale value for
+         * useShared then there is no foul below, but those that sync on the
+         * lock must see the right value.
+         */
+        if (utfSize <= MAX_BUF_SIZE && useShared) {
+            synchronized (cacheLock) {
+                if (useShared) {
+                    useShared = false;
+                    makeBuf = false;
                 }
-				break;
-			case (byte) '\n':
-				return line.toString();
-			default:
-				if (foundTerminator) {
-					((PushbackInputStream) in).unread(nextByte);
-					return line.toString();
-				}
-				line.append((char) nextByte);
-			}
-		}
-	}
-
-	/**
-	 * Reads a 64-bit <code>long</code> value from this stream.
-	 * 
-	 * @return the next <code>long</code> value from the source stream.
-	 * 
-	 * @throws IOException
-	 *             If a problem occurs reading from this DataInputStream.
-	 * 
-	 * @see DataOutput#writeLong(long)
-	 */
-	public final long readLong() throws IOException {
-		int i1 = readInt();
-		int b1 = in.read();
-		int b2 = in.read();
-		int b3 = in.read();
-		int b4 = in.read();
-		if ((b1 | b2 | b3 | b4) >= 0) {
-            return (((long) i1) << 32) + ((long) b1 << 24) + (b2 << 16)
-					+ (b3 << 8) + b4;
-        }
-		throw new EOFException();
-	}
-
-	/**
-	 * Reads a 16-bit <code>short</code> value from this stream.
-	 * 
-	 * @return the next <code>short</code> value from the source stream.
-	 * 
-	 * @throws IOException
-	 *             If a problem occurs reading from this DataInputStream.
-	 * 
-	 * @see DataOutput#writeShort(int)
-	 */
-	public final short readShort() throws IOException {
-		int b1 = in.read();
-		int b2 = in.read();
-		if ((b1 | b2) >= 0) {
-            return (short) ((b1 << 8) + b2);
-        }
-		throw new EOFException();
-	}
-
-	/**
-	 * Reads an unsigned 8-bit <code>byte</code> value from this stream and
-	 * returns it as an int.
-	 * 
-	 * @return the next unsigned byte value from the source stream.
-	 * 
-	 * @throws IOException
-	 *             If a problem occurs reading from this DataInputStream.
-	 * 
-	 * @see DataOutput#writeByte(int)
-	 */
-	public final int readUnsignedByte() throws IOException {
-		int temp = in.read();
-		if (temp >= 0) {
-            return temp;
-        }
-		throw new EOFException();
-	}
-
-	/**
-	 * Reads a 16-bit unsigned <code>short</code> value from this stream and
-	 * returns it as an int.
-	 * 
-	 * @return the next unsigned <code>short</code> value from the source
-	 *         stream.
-	 * 
-	 * @throws IOException
-	 *             If a problem occurs reading from this DataInputStream.
-	 * 
-	 * @see DataOutput#writeShort(int)
-	 */
-	public final int readUnsignedShort() throws IOException {
-		int b1 = in.read();
-		int b2 = in.read();
-		if ((b1 | b2) >= 0) {
-            return ((b1 << 8) + b2);
-        }
-		throw new EOFException();
-	}
-
-	/**
-	 * Reads a UTF format String from this Stream.
-	 * 
-	 * @return the next UTF String from the source stream.
-	 * 
-	 * @throws IOException
-	 *             If a problem occurs reading from this DataInputStream.
-	 * 
-	 * @see DataOutput#writeUTF(java.lang.String)
-	 */
-	public final String readUTF() throws IOException {
-		int utfSize = readUnsignedShort();
-		return decodeUTF(utfSize);
-	}
-
-	static final int MAX_BUF_SIZE = 8192;
-
-    private static class CacheLock {}
-	static final Object cacheLock = new CacheLock();
-	
-	static boolean useShared = true;
-
-	static byte[] byteBuf = new byte[0];
-
-	static char[] charBuf = new char[0];
-
-	String decodeUTF(int utfSize) throws IOException {
-		byte[] buf;
-		char[] out = null;
-		boolean makeBuf = true;
-
-		/*
-		 * Try to avoid the synchronization -- if we get a stale value for
-		 * useShared then there is no foul below, but those that sync on the
-		 * lock must see the right value.
-		 */
-		if (utfSize <= MAX_BUF_SIZE && useShared) {
-			synchronized (cacheLock) {
-				if (useShared) {
-					useShared = false;
-					makeBuf = false;
-				}
-			}
-		}
-		if (makeBuf) {
-			buf = new byte[utfSize];
-			out = new char[utfSize];
-		} else {
-			/*
-			 * Need to 'sample' byteBuf and charBuf before using them because
-			 * they are not protected by the cacheLock. They may get out of sync
-			 * with the static and one another, but that is ok because we
-			 * explicitly check and fix their length after sampling.
-			 */
-			buf = byteBuf;
-			if (buf.length < utfSize) {
+            }
+        }
+        if (makeBuf) {
+            buf = new byte[utfSize];
+            out = new char[utfSize];
+        } else {
+            /*
+             * Need to 'sample' byteBuf and charBuf before using them because
+             * they are not protected by the cacheLock. They may get out of sync
+             * with the static and one another, but that is ok because we
+             * explicitly check and fix their length after sampling.
+             */
+            buf = byteBuf;
+            if (buf.length < utfSize) {
                 buf = byteBuf = new byte[utfSize];
             }
-			out = charBuf;
-			if (out.length < utfSize) {
-				out = charBuf = new char[utfSize];
-			}
-		}
-
-		readFully(buf, 0, utfSize);
-		String result;
-		result = Util.convertUTF8WithBuf(buf, out, 0, utfSize);
-		if (!makeBuf) {
-			/*
-			 * Do not synchronize useShared on cacheLock, it will make it back
-			 * to main storage at some point, and no harm until it does.
-			 */
-			useShared = true;
-		}
-		return result;
-	}
-
-	/**
-	 * Reads a UTF format String from the DataInput Stream <code>in</code>.
-	 * 
-	 * @param in
-	 *            the input stream to read from
-	 * @return the next UTF String from the source stream.
-	 * 
-	 * @throws IOException
-	 *             If a problem occurs reading from this DataInputStream.
-	 * 
-	 * @see DataOutput#writeUTF(java.lang.String)
-	 */
-	public static final String readUTF(DataInput in) throws IOException {
-		return in.readUTF();
-	}
-
-	/**
-	 * Skips <code>count</code> number of bytes in this stream. Subsequent
-	 * <code>read()</code>'s will not return these bytes unless
-	 * <code>reset()</code> is used.
-	 * 
-	 * @param count
-	 *            the number of bytes to skip.
-	 * @return the number of bytes actually skipped.
-	 * 
-	 * @throws IOException
-	 *             If the stream is already closed or another IOException
-	 *             occurs.
-	 */
-	public final int skipBytes(int count) throws IOException {
-		int skipped = 0;
-		long skip;
-		while (skipped < count && (skip = in.skip(count - skipped)) != 0) {
-            skipped += skip;
+            out = charBuf;
+            if (out.length < utfSize) {
+                out = charBuf = new char[utfSize];
+            }
         }
-		if (skipped >= 0) {
-            return skipped;
+
+        readFully(buf, 0, utfSize);
+        String result;
+        result = Util.convertUTF8WithBuf(buf, out, 0, utfSize);
+        if (!makeBuf) {
+            /*
+             * Do not synchronize useShared on cacheLock, it will make it back
+             * to main storage at some point, and no harm until it does.
+             */
+            useShared = true;
         }
-		throw new EOFException();
-	}
+        return result;
+    }
+
+    /**
+     * Reads a UTF format String from the DataInput Stream <code>in</code>.
+     * 
+     * @param in
+     *            the input stream to read from
+     * @return the next UTF String from the source stream.
+     * 
+     * @throws IOException
+     *             If a problem occurs reading from this DataInputStream.
+     * 
+     * @see DataOutput#writeUTF(java.lang.String)
+     */
+    public static final String readUTF(DataInput in) throws IOException {
+        return in.readUTF();
+    }
 
+    /**
+     * Skips <code>count</code> number of bytes in this stream. Subsequent
+     * <code>read()</code>'s will not return these bytes unless
+     * <code>reset()</code> is used.
+     * 
+     * @param count
+     *            the number of bytes to skip.
+     * @return the number of bytes actually skipped.
+     * 
+     * @throws IOException
+     *             If the stream is already closed or another IOException
+     *             occurs.
+     */
+    public final int skipBytes(int count) throws IOException {
+        int skipped = 0;
+        long skip;
+        while (skipped < count && (skip = in.skip(count - skipped)) != 0) {
+            skipped += skip;
+        }
+        if (skipped < 0) {
+            throw new EOFException();
+        }
+        return skipped;
+    }
 }

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/DataOutput.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/DataOutput.java?view=diff&rev=492652&r1=492651&r2=492652
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/DataOutput.java (original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/DataOutput.java Thu Jan  4 09:47:01 2007
@@ -17,7 +17,6 @@
 
 package java.io;
 
-
 /**
  * DataOutput is an interface which declares methods for writing typed data to a
  * Stream. Typically, this stream can be read in by a class which implements
@@ -29,208 +28,208 @@
  */
 public interface DataOutput {
 
-	/**
-	 * Writes the entire contents of the byte array <code>buffer</code> to the
-	 * OutputStream.
-	 * 
-	 * @param buffer
-	 *            the buffer to be written
-	 * 
-	 * @throws IOException
-	 *             If an error occurs attempting to write to this stream.
-	 * 
-	 * @see DataInput#readFully(byte[])
-	 * @see DataInput#readFully(byte[], int, int)
-	 */
-	public abstract void write(byte buffer[]) throws IOException;
-
-	/**
-	 * Writes <code>count</code> <code>bytes</code> from the byte array
-	 * <code>buffer</code> starting at offset <code>index</code> to the
-	 * OutputStream.
-	 * 
-	 * @param buffer
-	 *            the buffer to be written
-	 * @param offset
-	 *            offset in buffer to get bytes
-	 * @param count
-	 *            number of bytes in buffer to write
-	 * 
-	 * @throws IOException
-	 *             If an error occurs attempting to write to this stream.
-	 * 
-	 * @see DataInput#readFully(byte[])
-	 * @see DataInput#readFully(byte[], int, int)
-	 */
-	public abstract void write(byte buffer[], int offset, int count)
-			throws IOException;
-
-	/**
-	 * Writes the specified <code>byte</code> to the OutputStream.
-	 * 
-	 * @param oneByte
-	 *            the byte to be written
-	 * 
-	 * @throws IOException
-	 *             If an error occurs attempting to write to this stream.
-	 * 
-	 * @see DataInput#readByte()
-	 */
-	public abstract void write(int oneByte) throws IOException;
-
-	/**
-	 * Writes a boolean to this output stream.
-	 * 
-	 * @param val
-	 *            the boolean value to write to the OutputStream
-	 * 
-	 * @throws IOException
-	 *             If an error occurs attempting to write to this stream.
-	 * 
-	 * @see DataInput#readBoolean()
-	 */
-	public abstract void writeBoolean(boolean val) throws IOException;
-
-	/**
-	 * Writes a 8-bit byte to this output stream.
-	 * 
-	 * @param val
-	 *            the byte value to write to the OutputStream
-	 * 
-	 * @throws IOException
-	 *             If an error occurs attempting to write to this stream.
-	 * 
-	 * @see DataInput#readByte()
-	 * @see DataInput#readUnsignedByte()
-	 */
-	public abstract void writeByte(int val) throws IOException;
-
-	/**
-	 * Writes the low order 8-bit bytes from a String to this output stream.
-	 * 
-	 * @param str
-	 *            the String containing the bytes to write to the OutputStream
-	 * 
-	 * @throws IOException
-	 *             If an error occurs attempting to write to this stream.
-	 * 
-	 * @see DataInput#readFully(byte[])
-	 * @see DataInput#readFully(byte[],int,int)
-	 */
-	public abstract void writeBytes(String str) throws IOException;
-
-	/**
-	 * Writes the specified 16-bit character to the OutputStream. Only the lower
-	 * 2 bytes are written with the higher of the 2 bytes written first. This
-	 * represents the Unicode value of val.
-	 * 
-	 * @param oneByte
-	 *            the character to be written
-	 * 
-	 * @throws IOException
-	 *             If an error occurs attempting to write to this stream.
-	 * 
-	 * @see DataInput#readChar()
-	 */
-	public abstract void writeChar(int oneByte) throws IOException;
-
-	/**
-	 * Writes the specified 16-bit characters contained in str to the
-	 * OutputStream. Only the lower 2 bytes of each character are written with
-	 * the higher of the 2 bytes written first. This represents the Unicode
-	 * value of each character in str.
-	 * 
-	 * @param str
-	 *            the String whose characters are to be written.
-	 * 
-	 * @throws IOException
-	 *             If an error occurs attempting to write to this stream.
-	 * 
-	 * @see DataInput#readChar()
-	 */
-	public abstract void writeChars(String str) throws IOException;
-
-	/**
-	 * Writes a 64-bit double to this output stream. The resulting output is the
-	 * 8 bytes resulting from calling Double.doubleToLongBits().
-	 * 
-	 * @param val
-	 *            the double to be written.
-	 * 
-	 * @throws IOException
-	 *             If an error occurs attempting to write to this stream.
-	 * 
-	 * @see DataInput#readDouble()
-	 */
-	public abstract void writeDouble(double val) throws IOException;
-
-	/**
-	 * Writes a 32-bit float to this output stream. The resulting output is the
-	 * 4 bytes resulting from calling Float.floatToIntBits().
-	 * 
-	 * @param val
-	 *            the float to be written.
-	 * 
-	 * @throws IOException
-	 *             If an error occurs attempting to write to this stream.
-	 * 
-	 * @see DataInput#readFloat()
-	 */
-	public abstract void writeFloat(float val) throws IOException;
-
-	/**
-	 * Writes a 32-bit int to this output stream. The resulting output is the 4
-	 * bytes, highest order first, of val.
-	 * 
-	 * @param val
-	 *            the int to be written.
-	 * 
-	 * @throws IOException
-	 *             If an error occurs attempting to write to this stream.
-	 * 
-	 * @see DataInput#readInt()
-	 */
-	public abstract void writeInt(int val) throws IOException;
-
-	/**
-	 * Writes a 64-bit long to this output stream. The resulting output is the 8
-	 * bytes, highest order first, of val.
-	 * 
-	 * @param val
-	 *            the long to be written.
-	 * 
-	 * @throws IOException
-	 *             If an error occurs attempting to write to this stream.
-	 * 
-	 * @see DataInput#readLong()
-	 */
-	public abstract void writeLong(long val) throws IOException;
-
-	/**
-	 * Writes the specified 16-bit short to the OutputStream. Only the lower 2
-	 * bytes are written with the higher of the 2 bytes written first.
-	 * 
-	 * @param val
-	 *            the short to be written
-	 * 
-	 * @throws IOException
-	 *             If an error occurs attempting to write to this stream.
-	 * 
-	 * @see DataInput#readShort()
-	 * @see DataInput#readUnsignedShort()
-	 */
-	public abstract void writeShort(int val) throws IOException;
-
-	/**
-	 * Writes the specified String out in UTF format.
-	 * 
-	 * @param str
-	 *            the String to be written in UTF format.
-	 * 
-	 * @throws IOException
-	 *             If an error occurs attempting to write to this stream.
-	 * 
-	 * @see DataInput#readUTF()
-	 */
-	public abstract void writeUTF(String str) throws IOException;
+    /**
+     * Writes the entire contents of the byte array <code>buffer</code> to the
+     * OutputStream.
+     * 
+     * @param buffer
+     *            the buffer to be written
+     * 
+     * @throws IOException
+     *             If an error occurs attempting to write to this stream.
+     * 
+     * @see DataInput#readFully(byte[])
+     * @see DataInput#readFully(byte[], int, int)
+     */
+    public abstract void write(byte buffer[]) throws IOException;
+
+    /**
+     * Writes <code>count</code> <code>bytes</code> from the byte array
+     * <code>buffer</code> starting at offset <code>index</code> to the
+     * OutputStream.
+     * 
+     * @param buffer
+     *            the buffer to be written
+     * @param offset
+     *            offset in buffer to get bytes
+     * @param count
+     *            number of bytes in buffer to write
+     * 
+     * @throws IOException
+     *             If an error occurs attempting to write to this stream.
+     * 
+     * @see DataInput#readFully(byte[])
+     * @see DataInput#readFully(byte[], int, int)
+     */
+    public abstract void write(byte buffer[], int offset, int count)
+            throws IOException;
+
+    /**
+     * Writes the specified <code>byte</code> to the OutputStream.
+     * 
+     * @param oneByte
+     *            the byte to be written
+     * 
+     * @throws IOException
+     *             If an error occurs attempting to write to this stream.
+     * 
+     * @see DataInput#readByte()
+     */
+    public abstract void write(int oneByte) throws IOException;
+
+    /**
+     * Writes a boolean to this output stream.
+     * 
+     * @param val
+     *            the boolean value to write to the OutputStream
+     * 
+     * @throws IOException
+     *             If an error occurs attempting to write to this stream.
+     * 
+     * @see DataInput#readBoolean()
+     */
+    public abstract void writeBoolean(boolean val) throws IOException;
+
+    /**
+     * Writes a 8-bit byte to this output stream.
+     * 
+     * @param val
+     *            the byte value to write to the OutputStream
+     * 
+     * @throws IOException
+     *             If an error occurs attempting to write to this stream.
+     * 
+     * @see DataInput#readByte()
+     * @see DataInput#readUnsignedByte()
+     */
+    public abstract void writeByte(int val) throws IOException;
+
+    /**
+     * Writes the low order 8-bit bytes from a String to this output stream.
+     * 
+     * @param str
+     *            the String containing the bytes to write to the OutputStream
+     * 
+     * @throws IOException
+     *             If an error occurs attempting to write to this stream.
+     * 
+     * @see DataInput#readFully(byte[])
+     * @see DataInput#readFully(byte[],int,int)
+     */
+    public abstract void writeBytes(String str) throws IOException;
+
+    /**
+     * Writes the specified 16-bit character to the OutputStream. Only the lower
+     * 2 bytes are written with the higher of the 2 bytes written first. This
+     * represents the Unicode value of val.
+     * 
+     * @param oneByte
+     *            the character to be written
+     * 
+     * @throws IOException
+     *             If an error occurs attempting to write to this stream.
+     * 
+     * @see DataInput#readChar()
+     */
+    public abstract void writeChar(int oneByte) throws IOException;
+
+    /**
+     * Writes the specified 16-bit characters contained in str to the
+     * OutputStream. Only the lower 2 bytes of each character are written with
+     * the higher of the 2 bytes written first. This represents the Unicode
+     * value of each character in str.
+     * 
+     * @param str
+     *            the String whose characters are to be written.
+     * 
+     * @throws IOException
+     *             If an error occurs attempting to write to this stream.
+     * 
+     * @see DataInput#readChar()
+     */
+    public abstract void writeChars(String str) throws IOException;
+
+    /**
+     * Writes a 64-bit double to this output stream. The resulting output is the
+     * 8 bytes resulting from calling Double.doubleToLongBits().
+     * 
+     * @param val
+     *            the double to be written.
+     * 
+     * @throws IOException
+     *             If an error occurs attempting to write to this stream.
+     * 
+     * @see DataInput#readDouble()
+     */
+    public abstract void writeDouble(double val) throws IOException;
+
+    /**
+     * Writes a 32-bit float to this output stream. The resulting output is the
+     * 4 bytes resulting from calling Float.floatToIntBits().
+     * 
+     * @param val
+     *            the float to be written.
+     * 
+     * @throws IOException
+     *             If an error occurs attempting to write to this stream.
+     * 
+     * @see DataInput#readFloat()
+     */
+    public abstract void writeFloat(float val) throws IOException;
+
+    /**
+     * Writes a 32-bit int to this output stream. The resulting output is the 4
+     * bytes, highest order first, of val.
+     * 
+     * @param val
+     *            the int to be written.
+     * 
+     * @throws IOException
+     *             If an error occurs attempting to write to this stream.
+     * 
+     * @see DataInput#readInt()
+     */
+    public abstract void writeInt(int val) throws IOException;
+
+    /**
+     * Writes a 64-bit long to this output stream. The resulting output is the 8
+     * bytes, highest order first, of val.
+     * 
+     * @param val
+     *            the long to be written.
+     * 
+     * @throws IOException
+     *             If an error occurs attempting to write to this stream.
+     * 
+     * @see DataInput#readLong()
+     */
+    public abstract void writeLong(long val) throws IOException;
+
+    /**
+     * Writes the specified 16-bit short to the OutputStream. Only the lower 2
+     * bytes are written with the higher of the 2 bytes written first.
+     * 
+     * @param val
+     *            the short to be written
+     * 
+     * @throws IOException
+     *             If an error occurs attempting to write to this stream.
+     * 
+     * @see DataInput#readShort()
+     * @see DataInput#readUnsignedShort()
+     */
+    public abstract void writeShort(int val) throws IOException;
+
+    /**
+     * Writes the specified String out in UTF format.
+     * 
+     * @param str
+     *            the String to be written in UTF format.
+     * 
+     * @throws IOException
+     *             If an error occurs attempting to write to this stream.
+     * 
+     * @see DataInput#readUTF()
+     */
+    public abstract void writeUTF(String str) throws IOException;
 }

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/DataOutputStream.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/DataOutputStream.java?view=diff&rev=492652&r1=492651&r2=492652
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/DataOutputStream.java (original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/DataOutputStream.java Thu Jan  4 09:47:01 2007
@@ -28,6 +28,7 @@
  * @see DataInputStream
  */
 public class DataOutputStream extends FilterOutputStream implements DataOutput {
+
     /** The number of bytes written out so far */
     protected int written;
 
@@ -368,8 +369,7 @@
                 writeShort((int) utfCount);
                 writeUTFBytes(str, utfCount);
             } else {
-                throw new UTFDataFormatException(
-                        org.apache.harmony.luni.util.Msg.getString("K0068")); //$NON-NLS-1$
+                throw new UTFDataFormatException(Msg.getString("K0068")); //$NON-NLS-1$
             }
         }
     }

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/EOFException.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/EOFException.java?view=diff&rev=492652&r1=492651&r2=492652
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/EOFException.java (original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/EOFException.java Thu Jan  4 09:47:01 2007
@@ -17,33 +17,30 @@
 
 package java.io;
 
-
 /**
  * This End Of File (EOF) exception is thrown when a program encounters the end
  * of a file or stream during an operation.
- * 
  */
 public class EOFException extends IOException {
-    
+
     private static final long serialVersionUID = 6433858223774886977L;
-    
-	/**
-	 * Constructs a new instance of this class with its walkback filled in.
-	 * 
-	 */
-	public EOFException() {
-		super();
-	}
 
-	/**
-	 * Constructs a new instance of this class with its walkback and message
-	 * filled in.
-	 * 
-	 * @param detailMessage
-	 *            The detail message for the exception.
-	 */
-	public EOFException(String detailMessage) {
-		super(detailMessage);
-	}
+    /**
+     * Constructs a new instance of this class with its walkback filled in.
+     * 
+     */
+    public EOFException() {
+        super();
+    }
 
+    /**
+     * Constructs a new instance of this class with its walkback and message
+     * filled in.
+     * 
+     * @param detailMessage
+     *            The detail message for the exception.
+     */
+    public EOFException(String detailMessage) {
+        super(detailMessage);
+    }
 }



Mime
View raw message