harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From telli...@apache.org
Subject svn commit: r546267 - /harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/io/PipedReader.java
Date Mon, 11 Jun 2007 20:46:19 GMT
Author: tellison
Date: Mon Jun 11 13:46:18 2007
New Revision: 546267

URL: http://svn.apache.org/viewvc?view=rev&rev=546267
Log:
Apply patch HARMONY-4096 ([classlib][luni][java6]new constructor in java.io.PipedReader)

Modified:
    harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/io/PipedReader.java

Modified: harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/io/PipedReader.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/io/PipedReader.java?view=diff&rev=546267&r1=546266&r2=546267
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/io/PipedReader.java
(original)
+++ harmony/enhanced/classlib/branches/java6/modules/luni/src/main/java/java/io/PipedReader.java
Mon Jun 11 13:46:18 2007
@@ -67,6 +67,44 @@
     }
 
     /**
+     * Constructs a new unconnected PipedReader and the buffer size is
+     * specified. The resulting Reader must be connected to a PipedWriter before
+     * data may be read from it.
+     * 
+     * @param size
+     *            the size of the buffer.
+     * @throws IllegalArgumentException
+     *             if pipeSize is less than or equal to zero.
+     * @since 1.6
+     */
+    public PipedReader(int size) {
+        if (size <= 0) {
+            throw new IllegalArgumentException();
+        }
+        data = new char[size];
+    }
+
+    /**
+     * Constructs a new PipedReader connected to the PipedWriter
+     * <code>out</code> and the buffer size is specified. Any data written to
the writer can be read from the
+     * this reader.
+     * 
+     * @param out
+     *            the PipedWriter to connect to.
+     * @param pipeSize
+     *            the size of the buffer.
+     * @throws IOException
+     *             if IO errors occur
+     * @throws IllegalArgumentException
+     *             if pipeSize is less than or equal to zero.
+     * @since 1.6
+     */
+    public PipedReader(PipedWriter out, int pipeSize) throws IOException {
+        this(pipeSize);
+        connect(out);
+    }
+
+    /**
      * Constructs a new PipedReader connected to the PipedWriter
      * <code>out</code>. Any data written to the writer can be read from the
      * this reader.



Mime
View raw message