harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ndbe...@apache.org
Subject svn commit: r432462 [1/21] - /incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/
Date Fri, 18 Aug 2006 01:45:39 GMT
Author: ndbeyer
Date: Thu Aug 17 18:45:35 2006
New Revision: 432462

URL: http://svn.apache.org/viewvc?rev=432462&view=rev
Log:
Set svn:eol-style = native for java.io

Modified:
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/BufferedInputStream.java   (contents, props changed)
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/CharArrayReader.java   (contents, props changed)
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/CharArrayWriter.java   (contents, props changed)
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/CharConversionException.java   (contents, props changed)
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/Closeable.java   (contents, props changed)
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/DataInput.java   (contents, props changed)
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/DataInputStream.java   (contents, props changed)
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/DataOutput.java   (contents, props changed)
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/DataOutputStream.java   (contents, props changed)
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/EOFException.java   (contents, props changed)
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/EmulatedFields.java   (contents, props changed)
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/EmulatedFieldsForDumping.java   (contents, props changed)
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/EmulatedFieldsForLoading.java   (contents, props changed)
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/Externalizable.java   (contents, props changed)
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/File.java   (contents, props changed)
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/FileDescriptor.java   (contents, props changed)
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/FileFilter.java   (contents, props changed)
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/FileInputStream.java   (contents, props changed)
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/FileNotFoundException.java   (contents, props changed)
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/FileOutputStream.java   (contents, props changed)
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/FilePermission.java   (contents, props changed)
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/FilePermissionCollection.java   (contents, props changed)
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/FileReader.java   (contents, props changed)
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/FileWriter.java   (contents, props changed)
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/FilenameFilter.java   (contents, props changed)
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/FilterInputStream.java   (contents, props changed)
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/FilterOutputStream.java   (contents, props changed)
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/FilterReader.java   (contents, props changed)
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/FilterWriter.java   (contents, props changed)
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/Flushable.java   (contents, props changed)
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/IOException.java   (contents, props changed)
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/InputStream.java   (contents, props changed)
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/InputStreamReader.java   (contents, props changed)
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/InterruptedIOException.java   (contents, props changed)
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/InvalidClassException.java   (contents, props changed)
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/InvalidObjectException.java   (contents, props changed)
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/LineNumberInputStream.java   (contents, props changed)
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/LineNumberReader.java   (contents, props changed)
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/NotActiveException.java   (contents, props changed)
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/NotSerializableException.java   (contents, props changed)
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/ObjectInput.java   (contents, props changed)
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/ObjectInputStream.java   (contents, props changed)
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/ObjectInputValidation.java   (contents, props changed)
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/ObjectOutput.java   (contents, props changed)
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/ObjectOutputStream.java   (contents, props changed)
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/ObjectStreamClass.java   (contents, props changed)
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/ObjectStreamConstants.java   (contents, props changed)
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/ObjectStreamException.java   (contents, props changed)
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/ObjectStreamField.java   (contents, props changed)
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/OptionalDataException.java   (contents, props changed)
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/OutputStream.java   (contents, props changed)
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/OutputStreamWriter.java   (contents, props changed)
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/PipedInputStream.java   (contents, props changed)
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/PipedOutputStream.java   (contents, props changed)
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/PipedReader.java   (contents, props changed)
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/PipedWriter.java   (contents, props changed)
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/PrintStream.java   (contents, props changed)
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/PrintWriter.java   (contents, props changed)
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/PushbackInputStream.java   (contents, props changed)
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/PushbackReader.java   (contents, props changed)
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/RandomAccessFile.java   (contents, props changed)
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/Reader.java   (contents, props changed)
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/SequenceInputStream.java   (contents, props changed)
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/Serializable.java   (contents, props changed)
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/SerializablePermission.java   (contents, props changed)
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/StreamCorruptedException.java   (contents, props changed)
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/StreamTokenizer.java   (contents, props changed)
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/StringBufferInputStream.java   (contents, props changed)
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/StringReader.java   (contents, props changed)
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/StringWriter.java   (contents, props changed)
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/SyncFailedException.java   (contents, props changed)
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/UTFDataFormatException.java   (contents, props changed)
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/UnsupportedEncodingException.java   (contents, props changed)
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/WriteAbortedException.java   (contents, props changed)
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/Writer.java   (contents, props changed)

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/BufferedInputStream.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/BufferedInputStream.java?rev=432462&r1=432461&r2=432462&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/BufferedInputStream.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/BufferedInputStream.java Thu Aug 17 18:45:35 2006
@@ -1,370 +1,370 @@
-/* Copyright 1998, 2006 The Apache Software Foundation or its licensors, as applicable
- * 
- * Licensed 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.
- */
-
-package java.io;
-
-import org.apache.harmony.luni.util.Msg;
-
-/**
- * <code>BufferedInputStream</code> is a class which takes an input stream and
- * <em>buffers</em> the input. In this way, costly interaction with the
- * original input stream can be minimized by reading buffered amounts of data
- * infrequently. The drawback is that extra space is required to hold the buffer
- * and that copying takes place when reading that buffer.
- * 
- * @see BufferedOutputStream
- */
-public class BufferedInputStream extends FilterInputStream {
-    /**
-     * The buffer containing the current bytes read from the target InputStream.
-     */
-    protected byte[] buf;
-
-    /**
-     * The total number of bytes inside the byte array <code>buf</code>.
-     */
-    protected int count;
-
-    /**
-     * The current limit, which when passed, invalidates the current mark.
-     */
-    protected int marklimit;
-
-    /**
-     * The currently marked position. -1 indicates no mark has been set or the
-     * mark has been invalidated.
-     */
-    protected int markpos = -1;
-
-    /**
-     * The current position within the byte array <code>buf</code>.
-     */
-    protected int pos;
-    
-    private boolean closed = false;
-    
-    
-
-    /**
-     * Constructs a new <code>BufferedInputStream</code> on the InputStream
-     * <code>in</code>. The default buffer size (2K) is allocated and all
-     * reads can now be filtered through this stream.
-     * 
-     * @param in
-     *            the InputStream to buffer reads on.
-     */
-    public BufferedInputStream(InputStream in) {
-        super(in);
-        buf = (in == null) ? null : new byte[2048];
-    }
-
-    /**
-     * Constructs a new BufferedInputStream on the InputStream <code>in</code>.
-     * The buffer size is specified by the parameter <code>size</code> and all
-     * reads can now be filtered through this BufferedInputStream.
-     * 
-     * @param in
-     *            the InputStream to buffer reads on.
-     * @param size
-     *            the size of buffer to allocate.
-     */
-    public BufferedInputStream(InputStream in, int size) {
-        super(in);
-        if (size > 0) {
-            buf = (in == null) ? null : new byte[size];
-        } else {
-            throw new IllegalArgumentException(Msg.getString("K0058")); //$NON-NLS-1$
-        }
-    }
-
-    /**
-     * Answers an int representing the number of bytes that are available before
-     * this BufferedInputStream will block. This method returns the number of
-     * bytes available in the buffer plus those available in the target stream.
-     * 
-     * @return the number of bytes available before blocking.
-     * 
-     * @throws IOException
-     *             If an error occurs in this stream.
-     */
-    @Override
-    public synchronized int available() throws IOException {
-        if (buf == null) {
-            throw new IOException(Msg.getString("K0059")); //$NON-NLS-1$
-        }
-        return count - pos + in.available();
-    }
-
-    /**
-     * Close this BufferedInputStream. This implementation closes the target
-     * stream and releases any resources associated with it.
-     * 
-     * @throws IOException
-     *             If an error occurs attempting to close this stream.
-     */
-    @Override
-    public synchronized void close() throws IOException {
-    	if(null != in ){
-            super.close();
-            in = null;
-    	}
-        buf = null;
-        closed = true;
-    }
-
-    private int fillbuf() throws IOException {
-        if (markpos == -1 || (pos - markpos >= marklimit)) {
-            /* Mark position not set or exceeded readlimit */
-            int result = in.read(buf);
-            if (result > 0) {
-                markpos = -1;
-                pos = 0;
-                count = result == -1 ? 0 : result;
-            }
-            return result;
-        }
-        if (markpos == 0 && marklimit > buf.length) {
-            /* Increase buffer size to accomodate the readlimit */
-            int newLength = buf.length * 2;
-            if (newLength > marklimit) {
-                newLength = marklimit;
-            }
-            byte[] newbuf = new byte[newLength];
-            System.arraycopy(buf, 0, newbuf, 0, buf.length);
-            buf = newbuf;
-        } else if (markpos > 0) {
-            System.arraycopy(buf, markpos, buf, 0, buf.length - markpos);
-        }
-        /* Set the new position and mark position */
-        pos -= markpos;
-        count = markpos = 0;
-        int bytesread = in.read(buf, pos, buf.length - pos);
-        count = bytesread <= 0 ? pos : pos + bytesread;
-        return bytesread;
-    }
-
-    /**
-     * Set a Mark position in this BufferedInputStream. The parameter
-     * <code>readLimit</code> indicates how many bytes can be read before a
-     * mark is invalidated. Sending reset() will reposition the Stream back to
-     * the marked position provided <code>readLimit</code> has not been
-     * surpassed. The underlying buffer may be increased in size to allow
-     * <code>readlimit</code> number of bytes to be supported.
-     * 
-     * @param readlimit
-     *            the number of bytes to be able to read before invalidating the
-     *            mark.
-     */
-    @Override
-    public synchronized void mark(int readlimit) {
-        marklimit = readlimit;
-        markpos = pos;
-    }
-
-    /**
-     * Answers a boolean indicating whether or not this BufferedInputStream
-     * supports mark() and reset(). This implementation answers
-     * <code>true</code>.
-     * 
-     * @return <code>true</code> for BufferedInputStreams.
-     */
-    @Override
-    public boolean markSupported() {
-        return true;
-    }
-
-    /**
-     * Reads a single byte from this BufferedInputStream and returns the result
-     * as an int. The low-order byte is returned or -1 of the end of stream was
-     * encountered. If the underlying buffer does not contain any available
-     * bytes then it is filled and the first byte is returned.
-     * 
-     * @return the byte read or -1 if end of stream.
-     * 
-     * @throws IOException
-     *             If the stream is already closed or another IOException
-     *             occurs.
-     */
-    @Override
-    public synchronized int read() throws IOException {
-        if (buf != null) {
-            /* Are there buffered bytes available? */
-            if (pos >= count && fillbuf() == -1) {
-                return -1; /* no, fill buffer */
-            }
-
-            /* Did filling the buffer fail with -1 (EOF)? */
-            if (count - pos > 0) {
-                return buf[pos++] & 0xFF;
-            }
-            return -1;
-        }
-        throw new IOException(Msg.getString("K0059")); //$NON-NLS-1$
-    }
-
-    /**
-     * Reads at most <code>length</code> bytes from this BufferedInputStream
-     * and stores them in byte array <code>buffer</code> starting at offset
-     * <code>offset</code>. Answer the number of bytes actually read or -1 if
-     * no bytes were read and end of stream was encountered. If all the buffered
-     * bytes have been used, a mark has not been set, and the requested number
-     * of bytes is larger than the receiver's buffer size, this implementation
-     * bypasses the buffer and simply places the results directly into
-     * <code>buffer</code>.
-     * 
-     * @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 the stream is already closed or another IOException
-     *             occurs.
-     */
-    @Override
-    public synchronized int read(byte[] buffer, int offset, int length)
-			throws IOException {
-		if (closed) {
-			throw new IOException(Msg.getString("K0059")); //$NON-NLS-1$
-		}
-		// avoid int overflow
-		if (offset > buffer.length - length || offset < 0 || length < 0) {
-			throw new IndexOutOfBoundsException();
-		}
-		if (length == 0) {
-			return 0;
-		}
-		if (null == buf) {
-			throw new IOException(Msg.getString("K0059")); //$NON-NLS-1$
-		}
-
-		int required;
-		if (pos < count) {
-			/* There are bytes available in the buffer. */
-			int copylength = count - pos >= length ? length : count - pos;
-			System.arraycopy(buf, pos, buffer, offset, copylength);
-			pos += copylength;
-			if (copylength == length || in.available() == 0) {
-				return copylength;
-			}
-			offset += copylength;
-			required = length - copylength;
-		} else {
-			required = length;
-		}
-
-		while (true) {
-			int read;
-			/*
-			 * If we're not marked and the required size is greater than the
-			 * buffer, simply read the bytes directly bypassing the buffer.
-			 */
-			if (markpos == -1 && required >= buf.length) {
-				read = in.read(buffer, offset, required);
-				if (read == -1) {
-					return required == length ? -1 : length - required;
-				}
-			} else {
-				if (fillbuf() == -1) {
-					return required == length ? -1 : length - required;
-				}
-				read = count - pos >= required ? required : count - pos;
-				System.arraycopy(buf, pos, buffer, offset, read);
-				pos += read;
-			}
-			required -= read;
-			if (required == 0) {
-				return length;
-			}
-			if (in.available() == 0) {
-				return length - required;
-			}
-			offset += read;
-		}
-	}
-
-    /**
-     * Reset this BufferedInputStream to the last marked location. If the
-     * <code>readlimit</code> has been passed or no <code>mark</code> has
-     * been set, throw IOException. This implementation resets the target
-     * stream.
-     * 
-     * @throws IOException
-     *             If the stream is already closed or another IOException
-     *             occurs.
-     */
-
-    @Override
-    public synchronized void reset() throws IOException {
-    	if (closed) {
-    		throw new IOException(Msg.getString("K0059")); //$NON-NLS-1$	
-    	}
-        if (-1 == markpos) {
-        	throw new IOException(Msg.getString("K005a")); //$NON-NLS-1$
-        }    
-        pos = markpos;         
-    }
-
-    /**
-     * Skips <code>amount</code> number of bytes in this BufferedInputStream.
-     * Subsequent <code>read()</code>'s will not return these bytes unless
-     * <code>reset()</code> is used.
-     * 
-     * @param amount
-     *            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.
-     */
-    @Override
-    public synchronized long skip(long amount) throws IOException {
-        if (null == in) {
-            throw new IOException(Msg.getString("K0059")); //$NON-NLS-1$
-        }
-        if (amount < 1) {
-            return 0;
-        }
-
-        if (count - pos >= amount) {
-            pos += amount;
-            return amount;
-        }
-        long read = count - pos;
-        pos = count;
-
-        if (markpos != -1) {
-            if (amount <= marklimit) {
-                if (fillbuf() == -1) {
-                    return read;
-                }
-                if (count - pos >= amount - read) {
-                    pos += amount - read;
-                    return amount;
-                }
-                // Couldn't get all the bytes, skip what we read
-                read += (count - pos);
-                pos = count;
-                return read;
-            }
-            markpos = -1;
-        }
-        return read + in.skip(amount - read);
-    }
-}
+/* Copyright 1998, 2006 The Apache Software Foundation or its licensors, as applicable
+ * 
+ * Licensed 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.
+ */
+
+package java.io;
+
+import org.apache.harmony.luni.util.Msg;
+
+/**
+ * <code>BufferedInputStream</code> is a class which takes an input stream and
+ * <em>buffers</em> the input. In this way, costly interaction with the
+ * original input stream can be minimized by reading buffered amounts of data
+ * infrequently. The drawback is that extra space is required to hold the buffer
+ * and that copying takes place when reading that buffer.
+ * 
+ * @see BufferedOutputStream
+ */
+public class BufferedInputStream extends FilterInputStream {
+    /**
+     * The buffer containing the current bytes read from the target InputStream.
+     */
+    protected byte[] buf;
+
+    /**
+     * The total number of bytes inside the byte array <code>buf</code>.
+     */
+    protected int count;
+
+    /**
+     * The current limit, which when passed, invalidates the current mark.
+     */
+    protected int marklimit;
+
+    /**
+     * The currently marked position. -1 indicates no mark has been set or the
+     * mark has been invalidated.
+     */
+    protected int markpos = -1;
+
+    /**
+     * The current position within the byte array <code>buf</code>.
+     */
+    protected int pos;
+    
+    private boolean closed = false;
+    
+    
+
+    /**
+     * Constructs a new <code>BufferedInputStream</code> on the InputStream
+     * <code>in</code>. The default buffer size (2K) is allocated and all
+     * reads can now be filtered through this stream.
+     * 
+     * @param in
+     *            the InputStream to buffer reads on.
+     */
+    public BufferedInputStream(InputStream in) {
+        super(in);
+        buf = (in == null) ? null : new byte[2048];
+    }
+
+    /**
+     * Constructs a new BufferedInputStream on the InputStream <code>in</code>.
+     * The buffer size is specified by the parameter <code>size</code> and all
+     * reads can now be filtered through this BufferedInputStream.
+     * 
+     * @param in
+     *            the InputStream to buffer reads on.
+     * @param size
+     *            the size of buffer to allocate.
+     */
+    public BufferedInputStream(InputStream in, int size) {
+        super(in);
+        if (size > 0) {
+            buf = (in == null) ? null : new byte[size];
+        } else {
+            throw new IllegalArgumentException(Msg.getString("K0058")); //$NON-NLS-1$
+        }
+    }
+
+    /**
+     * Answers an int representing the number of bytes that are available before
+     * this BufferedInputStream will block. This method returns the number of
+     * bytes available in the buffer plus those available in the target stream.
+     * 
+     * @return the number of bytes available before blocking.
+     * 
+     * @throws IOException
+     *             If an error occurs in this stream.
+     */
+    @Override
+    public synchronized int available() throws IOException {
+        if (buf == null) {
+            throw new IOException(Msg.getString("K0059")); //$NON-NLS-1$
+        }
+        return count - pos + in.available();
+    }
+
+    /**
+     * Close this BufferedInputStream. This implementation closes the target
+     * stream and releases any resources associated with it.
+     * 
+     * @throws IOException
+     *             If an error occurs attempting to close this stream.
+     */
+    @Override
+    public synchronized void close() throws IOException {
+    	if(null != in ){
+            super.close();
+            in = null;
+    	}
+        buf = null;
+        closed = true;
+    }
+
+    private int fillbuf() throws IOException {
+        if (markpos == -1 || (pos - markpos >= marklimit)) {
+            /* Mark position not set or exceeded readlimit */
+            int result = in.read(buf);
+            if (result > 0) {
+                markpos = -1;
+                pos = 0;
+                count = result == -1 ? 0 : result;
+            }
+            return result;
+        }
+        if (markpos == 0 && marklimit > buf.length) {
+            /* Increase buffer size to accomodate the readlimit */
+            int newLength = buf.length * 2;
+            if (newLength > marklimit) {
+                newLength = marklimit;
+            }
+            byte[] newbuf = new byte[newLength];
+            System.arraycopy(buf, 0, newbuf, 0, buf.length);
+            buf = newbuf;
+        } else if (markpos > 0) {
+            System.arraycopy(buf, markpos, buf, 0, buf.length - markpos);
+        }
+        /* Set the new position and mark position */
+        pos -= markpos;
+        count = markpos = 0;
+        int bytesread = in.read(buf, pos, buf.length - pos);
+        count = bytesread <= 0 ? pos : pos + bytesread;
+        return bytesread;
+    }
+
+    /**
+     * Set a Mark position in this BufferedInputStream. The parameter
+     * <code>readLimit</code> indicates how many bytes can be read before a
+     * mark is invalidated. Sending reset() will reposition the Stream back to
+     * the marked position provided <code>readLimit</code> has not been
+     * surpassed. The underlying buffer may be increased in size to allow
+     * <code>readlimit</code> number of bytes to be supported.
+     * 
+     * @param readlimit
+     *            the number of bytes to be able to read before invalidating the
+     *            mark.
+     */
+    @Override
+    public synchronized void mark(int readlimit) {
+        marklimit = readlimit;
+        markpos = pos;
+    }
+
+    /**
+     * Answers a boolean indicating whether or not this BufferedInputStream
+     * supports mark() and reset(). This implementation answers
+     * <code>true</code>.
+     * 
+     * @return <code>true</code> for BufferedInputStreams.
+     */
+    @Override
+    public boolean markSupported() {
+        return true;
+    }
+
+    /**
+     * Reads a single byte from this BufferedInputStream and returns the result
+     * as an int. The low-order byte is returned or -1 of the end of stream was
+     * encountered. If the underlying buffer does not contain any available
+     * bytes then it is filled and the first byte is returned.
+     * 
+     * @return the byte read or -1 if end of stream.
+     * 
+     * @throws IOException
+     *             If the stream is already closed or another IOException
+     *             occurs.
+     */
+    @Override
+    public synchronized int read() throws IOException {
+        if (buf != null) {
+            /* Are there buffered bytes available? */
+            if (pos >= count && fillbuf() == -1) {
+                return -1; /* no, fill buffer */
+            }
+
+            /* Did filling the buffer fail with -1 (EOF)? */
+            if (count - pos > 0) {
+                return buf[pos++] & 0xFF;
+            }
+            return -1;
+        }
+        throw new IOException(Msg.getString("K0059")); //$NON-NLS-1$
+    }
+
+    /**
+     * Reads at most <code>length</code> bytes from this BufferedInputStream
+     * and stores them in byte array <code>buffer</code> starting at offset
+     * <code>offset</code>. Answer the number of bytes actually read or -1 if
+     * no bytes were read and end of stream was encountered. If all the buffered
+     * bytes have been used, a mark has not been set, and the requested number
+     * of bytes is larger than the receiver's buffer size, this implementation
+     * bypasses the buffer and simply places the results directly into
+     * <code>buffer</code>.
+     * 
+     * @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 the stream is already closed or another IOException
+     *             occurs.
+     */
+    @Override
+    public synchronized int read(byte[] buffer, int offset, int length)
+			throws IOException {
+		if (closed) {
+			throw new IOException(Msg.getString("K0059")); //$NON-NLS-1$
+		}
+		// avoid int overflow
+		if (offset > buffer.length - length || offset < 0 || length < 0) {
+			throw new IndexOutOfBoundsException();
+		}
+		if (length == 0) {
+			return 0;
+		}
+		if (null == buf) {
+			throw new IOException(Msg.getString("K0059")); //$NON-NLS-1$
+		}
+
+		int required;
+		if (pos < count) {
+			/* There are bytes available in the buffer. */
+			int copylength = count - pos >= length ? length : count - pos;
+			System.arraycopy(buf, pos, buffer, offset, copylength);
+			pos += copylength;
+			if (copylength == length || in.available() == 0) {
+				return copylength;
+			}
+			offset += copylength;
+			required = length - copylength;
+		} else {
+			required = length;
+		}
+
+		while (true) {
+			int read;
+			/*
+			 * If we're not marked and the required size is greater than the
+			 * buffer, simply read the bytes directly bypassing the buffer.
+			 */
+			if (markpos == -1 && required >= buf.length) {
+				read = in.read(buffer, offset, required);
+				if (read == -1) {
+					return required == length ? -1 : length - required;
+				}
+			} else {
+				if (fillbuf() == -1) {
+					return required == length ? -1 : length - required;
+				}
+				read = count - pos >= required ? required : count - pos;
+				System.arraycopy(buf, pos, buffer, offset, read);
+				pos += read;
+			}
+			required -= read;
+			if (required == 0) {
+				return length;
+			}
+			if (in.available() == 0) {
+				return length - required;
+			}
+			offset += read;
+		}
+	}
+
+    /**
+     * Reset this BufferedInputStream to the last marked location. If the
+     * <code>readlimit</code> has been passed or no <code>mark</code> has
+     * been set, throw IOException. This implementation resets the target
+     * stream.
+     * 
+     * @throws IOException
+     *             If the stream is already closed or another IOException
+     *             occurs.
+     */
+
+    @Override
+    public synchronized void reset() throws IOException {
+    	if (closed) {
+    		throw new IOException(Msg.getString("K0059")); //$NON-NLS-1$	
+    	}
+        if (-1 == markpos) {
+        	throw new IOException(Msg.getString("K005a")); //$NON-NLS-1$
+        }    
+        pos = markpos;         
+    }
+
+    /**
+     * Skips <code>amount</code> number of bytes in this BufferedInputStream.
+     * Subsequent <code>read()</code>'s will not return these bytes unless
+     * <code>reset()</code> is used.
+     * 
+     * @param amount
+     *            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.
+     */
+    @Override
+    public synchronized long skip(long amount) throws IOException {
+        if (null == in) {
+            throw new IOException(Msg.getString("K0059")); //$NON-NLS-1$
+        }
+        if (amount < 1) {
+            return 0;
+        }
+
+        if (count - pos >= amount) {
+            pos += amount;
+            return amount;
+        }
+        long read = count - pos;
+        pos = count;
+
+        if (markpos != -1) {
+            if (amount <= marklimit) {
+                if (fillbuf() == -1) {
+                    return read;
+                }
+                if (count - pos >= amount - read) {
+                    pos += amount - read;
+                    return amount;
+                }
+                // Couldn't get all the bytes, skip what we read
+                read += (count - pos);
+                pos = count;
+                return read;
+            }
+            markpos = -1;
+        }
+        return read + in.skip(amount - read);
+    }
+}

Propchange: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/BufferedInputStream.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/CharArrayReader.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/CharArrayReader.java?rev=432462&r1=432461&r2=432462&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/CharArrayReader.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/CharArrayReader.java Thu Aug 17 18:45:35 2006
@@ -1,272 +1,272 @@
-/* Copyright 1998, 2005 The Apache Software Foundation or its licensors, as applicable
- * 
- * Licensed 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.
- */
-
-package java.io;
-
-
-/**
- * CharArrayReader is used as a buffered character input stream on a character
- * array.
- * 
- */
-public class CharArrayReader extends Reader {
-	/**
-	 * Buffer for characters
-	 */
-	protected char buf[];
-
-	/**
-	 * Current buffer position.
-	 */
-	protected int pos = 0;
-
-	/**
-	 * Current mark position.
-	 */
-	protected int markedPos = -1;
-
-	/**
-	 * The ending index of the buffer.
-	 */
-	protected int count = 0;
-
-	/**
-	 * Construct a CharArrayReader on the char array <code>buffer</code>. The
-	 * size of the reader is set to the <code>length()</code> of the buffer
-	 * and the Object to synchronize access through is set to
-	 * <code>buffer</code>.
-	 * 
-	 * @param buf
-	 *            the char array to filter reads on.
-	 */
-	public CharArrayReader(char[] buf) {
-		super(buf);
-		this.buf = buf;
-		this.count = buf.length;
-	}
-
-	/**
-	 * Construct a CharArrayReader on the char array <code>buffer</code>. The
-	 * size of the reader is set to the parameter <code>length()</code> and
-	 * the original offset is set to <code>offset</code>.
-	 * 
-	 * @param buf
-	 *            the char array to filter reads on.
-	 * @param offset
-	 *            the offset in <code>buf</code> to start streaming at.
-	 * @param length
-	 *            the number of characters available to stream over.
-	 */
-
-	public CharArrayReader(char[] buf, int offset, int length) {
-		super(buf);
-		if (0 <= offset && offset <= buf.length && length >= 0) {
-			this.buf = buf;
-			this.pos = offset;
-
-			/* This is according to spec */
-			this.count = this.pos + length < buf.length ? length : buf.length;
-		} else
-			throw new IllegalArgumentException();
-	}
-
-	/**
-	 * This method closes this CharArrayReader. Once it is closed, you can no
-	 * longer read from it. Only the first invocation of this method has any
-	 * effect.
-	 * 
-	 */
-	public void close() {
-		synchronized (lock) {
-			if (isOpen())
-				buf = null;
-		}
-	}
-
-	/**
-	 * Answer a boolean indicating whether or not this CharArrayReader is open.
-	 * 
-	 * @return <code>true</code> if the reader is open, <code>false</code>
-	 *         otherwise.
-	 */
-	private boolean isOpen() {
-		return buf != null;
-	}
-
-	/**
-	 * Set a Mark position in this Reader. The parameter <code>readLimit</code>
-	 * is ignored for CharArrayReaders. Sending reset() will reposition the
-	 * reader back to the marked position provided the mark has not been
-	 * invalidated.
-	 * @param readLimit
-	 *            ignored for CharArrayReaders.
-	 * 
-	 * @throws IOException
-	 *             If an error occurs attempting to mark this CharArrayReader.
-	 */
-	public void mark(int readLimit) throws IOException {
-		synchronized (lock) {
-			if (isOpen())
-				markedPos = pos;
-			else
-				throw new IOException(org.apache.harmony.luni.util.Msg.getString("K0060")); //$NON-NLS-1$
-		}
-	}
-
-	/**
-	 * Answers a boolean indicating whether or not this CharArrayReader supports
-	 * mark() and reset(). This method always returns true.
-	 * 
-	 * @return indicates whether or not mark() and reset() are supported.
-	 */
-	public boolean markSupported() {
-		return true;
-	}
-
-	/**
-	 * Reads a single character from this CharArrayReader and returns the result
-	 * as an int. The 2 higher-order bytes are set to 0. If the end of reader
-	 * was encountered then return -1.
-	 * 
-	 * @return int the character read or -1 if end of reader.
-	 * 
-	 * @throws IOException
-	 *             If the CharArrayReader is already closed.
-	 */
-	public int read() throws IOException {
-		synchronized (lock) {
-			if (isOpen()) {
-				if (pos != count)
-					return buf[pos++];
-				return -1;
-			}
-			throw new IOException(org.apache.harmony.luni.util.Msg.getString("K0060")); //$NON-NLS-1$
-		}
-	}
-
-	/**
-	 * Reads at most <code>count</code> characters from this CharArrayReader
-	 * and stores them at <code>offset</code> in the character array
-	 * <code>buf</code>. Returns the number of characters actually read or -1
-	 * if the end of reader was encountered.
-	 * 
-	 * 
-	 * @param buffer
-	 *            character array to store the read characters
-	 * @param offset
-	 *            offset in buf to store the read characters
-	 * @param len
-	 *            maximum number of characters to read
-	 * @return number of characters read or -1 if end of reader.
-	 * 
-	 * @throws IOException
-	 *             If the CharArrayReader is closed.
-	 */
-
-	public int read(char buffer[], int offset, int len) throws IOException {
-		// avoid int overflow
-		if (0 <= offset && offset <= buffer.length && 0 <= len
-				&& len <= buffer.length - offset) {
-			synchronized (lock) {
-				if (isOpen()) {
-					if (pos < this.count) {
-						int bytesRead = pos + len > this.count ? this.count
-								- pos : len;
-						System.arraycopy(this.buf, pos, buffer, offset,
-								bytesRead);
-						pos += bytesRead;
-						return bytesRead;
-					}
-					return -1;
-				}
-				throw new IOException(org.apache.harmony.luni.util.Msg.getString("K0060")); //$NON-NLS-1$
-			}
-		}
-		throw new ArrayIndexOutOfBoundsException();
-	}
-
-	/**
-	 * Answers a <code>boolean</code> indicating whether or not this
-	 * CharArrayReader is ready to be read without blocking. If the result is
-	 * <code>true</code>, the next <code>read()</code> will not block. If
-	 * the result is <code>false</code> this Reader may or may not block when
-	 * <code>read()</code> is sent. The implementation in CharArrayReader
-	 * always returns <code>true</code> even when it has been closed.
-	 * 
-	 * @return <code>true</code> if the receiver will not block when
-	 *         <code>read()</code> is called, <code>false</code> if unknown
-	 *         or blocking will occur.
-	 * 
-	 * @throws IOException
-	 *             If the CharArrayReader is closed.
-	 */
-	public boolean ready() throws IOException {
-		synchronized (lock) {
-			if (isOpen()) {
-				return pos != count;
-			}
-			throw new IOException(org.apache.harmony.luni.util.Msg.getString("K0060")); //$NON-NLS-1$
-		}
-	}
-
-	/**
-	 * Reset this CharArrayReader's position to the last <code>mark()</code>
-	 * location. Invocations of <code>read()/skip()</code> will occur from
-	 * this new location. If this Reader was not marked, the CharArrayReader is
-	 * reset to the beginning of the String.
-	 * 
-	 * @throws IOException
-	 *             If this CharArrayReader has already been closed.
-	 */
-	public void reset() throws IOException {
-		synchronized (lock) {
-			if (isOpen())
-				pos = markedPos != -1 ? markedPos : 0;
-			else
-				throw new IOException(org.apache.harmony.luni.util.Msg.getString("K0060")); //$NON-NLS-1$
-		}
-	}
-
-	/**
-	 * Skips <code>count</code> number of characters in this CharArrayReader.
-	 * Subsequent <code>read()</code>'s will not return these characters
-	 * unless <code>reset()</code> is used.
-	 * 
-	 * @param n
-	 *            The number of characters to skip.
-	 * @return long The number of characters actually skipped.
-	 * 
-	 * @throws IOException
-	 *             If this CharArrayReader has already been closed.
-	 */
-	public long skip(long n) throws IOException {
-		synchronized (lock) {
-			if (isOpen()) {
-				if (n <= 0)
-					return 0;
-				long skipped = 0;
-				if (n < this.count - pos) {
-					pos = pos + (int) n;
-					skipped = n;
-				} else {
-					skipped = this.count - pos;
-					pos = this.count;
-				}
-				return skipped;
-			}
-			throw new IOException(org.apache.harmony.luni.util.Msg.getString("K0060")); //$NON-NLS-1$
-		}
-	}
-}
+/* Copyright 1998, 2005 The Apache Software Foundation or its licensors, as applicable
+ * 
+ * Licensed 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.
+ */
+
+package java.io;
+
+
+/**
+ * CharArrayReader is used as a buffered character input stream on a character
+ * array.
+ * 
+ */
+public class CharArrayReader extends Reader {
+	/**
+	 * Buffer for characters
+	 */
+	protected char buf[];
+
+	/**
+	 * Current buffer position.
+	 */
+	protected int pos = 0;
+
+	/**
+	 * Current mark position.
+	 */
+	protected int markedPos = -1;
+
+	/**
+	 * The ending index of the buffer.
+	 */
+	protected int count = 0;
+
+	/**
+	 * Construct a CharArrayReader on the char array <code>buffer</code>. The
+	 * size of the reader is set to the <code>length()</code> of the buffer
+	 * and the Object to synchronize access through is set to
+	 * <code>buffer</code>.
+	 * 
+	 * @param buf
+	 *            the char array to filter reads on.
+	 */
+	public CharArrayReader(char[] buf) {
+		super(buf);
+		this.buf = buf;
+		this.count = buf.length;
+	}
+
+	/**
+	 * Construct a CharArrayReader on the char array <code>buffer</code>. The
+	 * size of the reader is set to the parameter <code>length()</code> and
+	 * the original offset is set to <code>offset</code>.
+	 * 
+	 * @param buf
+	 *            the char array to filter reads on.
+	 * @param offset
+	 *            the offset in <code>buf</code> to start streaming at.
+	 * @param length
+	 *            the number of characters available to stream over.
+	 */
+
+	public CharArrayReader(char[] buf, int offset, int length) {
+		super(buf);
+		if (0 <= offset && offset <= buf.length && length >= 0) {
+			this.buf = buf;
+			this.pos = offset;
+
+			/* This is according to spec */
+			this.count = this.pos + length < buf.length ? length : buf.length;
+		} else
+			throw new IllegalArgumentException();
+	}
+
+	/**
+	 * This method closes this CharArrayReader. Once it is closed, you can no
+	 * longer read from it. Only the first invocation of this method has any
+	 * effect.
+	 * 
+	 */
+	public void close() {
+		synchronized (lock) {
+			if (isOpen())
+				buf = null;
+		}
+	}
+
+	/**
+	 * Answer a boolean indicating whether or not this CharArrayReader is open.
+	 * 
+	 * @return <code>true</code> if the reader is open, <code>false</code>
+	 *         otherwise.
+	 */
+	private boolean isOpen() {
+		return buf != null;
+	}
+
+	/**
+	 * Set a Mark position in this Reader. The parameter <code>readLimit</code>
+	 * is ignored for CharArrayReaders. Sending reset() will reposition the
+	 * reader back to the marked position provided the mark has not been
+	 * invalidated.
+	 * @param readLimit
+	 *            ignored for CharArrayReaders.
+	 * 
+	 * @throws IOException
+	 *             If an error occurs attempting to mark this CharArrayReader.
+	 */
+	public void mark(int readLimit) throws IOException {
+		synchronized (lock) {
+			if (isOpen())
+				markedPos = pos;
+			else
+				throw new IOException(org.apache.harmony.luni.util.Msg.getString("K0060")); //$NON-NLS-1$
+		}
+	}
+
+	/**
+	 * Answers a boolean indicating whether or not this CharArrayReader supports
+	 * mark() and reset(). This method always returns true.
+	 * 
+	 * @return indicates whether or not mark() and reset() are supported.
+	 */
+	public boolean markSupported() {
+		return true;
+	}
+
+	/**
+	 * Reads a single character from this CharArrayReader and returns the result
+	 * as an int. The 2 higher-order bytes are set to 0. If the end of reader
+	 * was encountered then return -1.
+	 * 
+	 * @return int the character read or -1 if end of reader.
+	 * 
+	 * @throws IOException
+	 *             If the CharArrayReader is already closed.
+	 */
+	public int read() throws IOException {
+		synchronized (lock) {
+			if (isOpen()) {
+				if (pos != count)
+					return buf[pos++];
+				return -1;
+			}
+			throw new IOException(org.apache.harmony.luni.util.Msg.getString("K0060")); //$NON-NLS-1$
+		}
+	}
+
+	/**
+	 * Reads at most <code>count</code> characters from this CharArrayReader
+	 * and stores them at <code>offset</code> in the character array
+	 * <code>buf</code>. Returns the number of characters actually read or -1
+	 * if the end of reader was encountered.
+	 * 
+	 * 
+	 * @param buffer
+	 *            character array to store the read characters
+	 * @param offset
+	 *            offset in buf to store the read characters
+	 * @param len
+	 *            maximum number of characters to read
+	 * @return number of characters read or -1 if end of reader.
+	 * 
+	 * @throws IOException
+	 *             If the CharArrayReader is closed.
+	 */
+
+	public int read(char buffer[], int offset, int len) throws IOException {
+		// avoid int overflow
+		if (0 <= offset && offset <= buffer.length && 0 <= len
+				&& len <= buffer.length - offset) {
+			synchronized (lock) {
+				if (isOpen()) {
+					if (pos < this.count) {
+						int bytesRead = pos + len > this.count ? this.count
+								- pos : len;
+						System.arraycopy(this.buf, pos, buffer, offset,
+								bytesRead);
+						pos += bytesRead;
+						return bytesRead;
+					}
+					return -1;
+				}
+				throw new IOException(org.apache.harmony.luni.util.Msg.getString("K0060")); //$NON-NLS-1$
+			}
+		}
+		throw new ArrayIndexOutOfBoundsException();
+	}
+
+	/**
+	 * Answers a <code>boolean</code> indicating whether or not this
+	 * CharArrayReader is ready to be read without blocking. If the result is
+	 * <code>true</code>, the next <code>read()</code> will not block. If
+	 * the result is <code>false</code> this Reader may or may not block when
+	 * <code>read()</code> is sent. The implementation in CharArrayReader
+	 * always returns <code>true</code> even when it has been closed.
+	 * 
+	 * @return <code>true</code> if the receiver will not block when
+	 *         <code>read()</code> is called, <code>false</code> if unknown
+	 *         or blocking will occur.
+	 * 
+	 * @throws IOException
+	 *             If the CharArrayReader is closed.
+	 */
+	public boolean ready() throws IOException {
+		synchronized (lock) {
+			if (isOpen()) {
+				return pos != count;
+			}
+			throw new IOException(org.apache.harmony.luni.util.Msg.getString("K0060")); //$NON-NLS-1$
+		}
+	}
+
+	/**
+	 * Reset this CharArrayReader's position to the last <code>mark()</code>
+	 * location. Invocations of <code>read()/skip()</code> will occur from
+	 * this new location. If this Reader was not marked, the CharArrayReader is
+	 * reset to the beginning of the String.
+	 * 
+	 * @throws IOException
+	 *             If this CharArrayReader has already been closed.
+	 */
+	public void reset() throws IOException {
+		synchronized (lock) {
+			if (isOpen())
+				pos = markedPos != -1 ? markedPos : 0;
+			else
+				throw new IOException(org.apache.harmony.luni.util.Msg.getString("K0060")); //$NON-NLS-1$
+		}
+	}
+
+	/**
+	 * Skips <code>count</code> number of characters in this CharArrayReader.
+	 * Subsequent <code>read()</code>'s will not return these characters
+	 * unless <code>reset()</code> is used.
+	 * 
+	 * @param n
+	 *            The number of characters to skip.
+	 * @return long The number of characters actually skipped.
+	 * 
+	 * @throws IOException
+	 *             If this CharArrayReader has already been closed.
+	 */
+	public long skip(long n) throws IOException {
+		synchronized (lock) {
+			if (isOpen()) {
+				if (n <= 0)
+					return 0;
+				long skipped = 0;
+				if (n < this.count - pos) {
+					pos = pos + (int) n;
+					skipped = n;
+				} else {
+					skipped = this.count - pos;
+					pos = this.count;
+				}
+				return skipped;
+			}
+			throw new IOException(org.apache.harmony.luni.util.Msg.getString("K0060")); //$NON-NLS-1$
+		}
+	}
+}

Propchange: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/CharArrayReader.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/CharArrayWriter.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/CharArrayWriter.java?rev=432462&r1=432461&r2=432462&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/CharArrayWriter.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/CharArrayWriter.java Thu Aug 17 18:45:35 2006
@@ -1,300 +1,300 @@
-/* Copyright 1998, 2006 The Apache Software Foundation or its licensors, as applicable
- * 
- * Licensed 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.
- */
-
-package java.io;
-
-
-/**
- * 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
- * accomodate 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
-			throw new IllegalArgumentException(org.apache.harmony.luni.util.Msg
-					.getString("K005e")); //$NON-NLS-1$
-	}
-
-	/**
-	 * Close this Writer. This is the concrete implementation required. This
-	 * particular implementation does nothing.
-	 * 
-	 */
-	public void close() {
-		/* empty */
-	}
-
-	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.
-	 * 
-	 */
-
-	public void flush() {
-		/* 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;
-		}
-	}
-
-	/**
-	 * 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.
-	 */
-	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
-	 */
-	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
-			throw new IndexOutOfBoundsException();
-	}
-
-	/**
-	 * 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
-	 */
-	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.
-	 */
-	public void write(String str, int offset, int len) {
-        if (str == null) {
-            throw new NullPointerException(org.apache.harmony.luni.util.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
-			throw new StringIndexOutOfBoundsException();
-	}
-
-	/**
-	 * 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.
-	 */
-	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
-	 */
-	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.
-	 */
-	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;
-	}
-}
+/* Copyright 1998, 2006 The Apache Software Foundation or its licensors, as applicable
+ * 
+ * Licensed 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.
+ */
+
+package java.io;
+
+
+/**
+ * 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
+ * accomodate 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
+			throw new IllegalArgumentException(org.apache.harmony.luni.util.Msg
+					.getString("K005e")); //$NON-NLS-1$
+	}
+
+	/**
+	 * Close this Writer. This is the concrete implementation required. This
+	 * particular implementation does nothing.
+	 * 
+	 */
+	public void close() {
+		/* empty */
+	}
+
+	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.
+	 * 
+	 */
+
+	public void flush() {
+		/* 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;
+		}
+	}
+
+	/**
+	 * 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.
+	 */
+	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
+	 */
+	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
+			throw new IndexOutOfBoundsException();
+	}
+
+	/**
+	 * 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
+	 */
+	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.
+	 */
+	public void write(String str, int offset, int len) {
+        if (str == null) {
+            throw new NullPointerException(org.apache.harmony.luni.util.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
+			throw new StringIndexOutOfBoundsException();
+	}
+
+	/**
+	 * 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.
+	 */
+	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
+	 */
+	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.
+	 */
+	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;
+	}
+}

Propchange: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/CharArrayWriter.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/CharConversionException.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/CharConversionException.java?rev=432462&r1=432461&r2=432462&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/CharConversionException.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/CharConversionException.java Thu Aug 17 18:45:35 2006
@@ -1,46 +1,46 @@
-/* Copyright 1998, 2004 The Apache Software Foundation or its licensors, as applicable
- * 
- * Licensed 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.
- */
-
-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);
-	}
-
-}
+/* Copyright 1998, 2004 The Apache Software Foundation or its licensors, as applicable
+ * 
+ * Licensed 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.
+ */
+
+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);
+	}
+
+}

Propchange: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/CharConversionException.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/Closeable.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/Closeable.java?rev=432462&r1=432461&r2=432462&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/Closeable.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/Closeable.java Thu Aug 17 18:45:35 2006
@@ -1,32 +1,32 @@
-/* Copyright 2006 The Apache Software Foundation or its licensors, as applicable
- * 
- * Licensed 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.
- */
-
-package java.io;
-
-/**
- * Closeable represents the source or destination of some data which can be
- * 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;
+/* Copyright 2006 The Apache Software Foundation or its licensors, as applicable
+ * 
+ * Licensed 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.
+ */
+
+package java.io;
+
+/**
+ * Closeable represents the source or destination of some data which can be
+ * 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;
 }

Propchange: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/io/Closeable.java
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message