Author: niallp Date: Wed Feb 6 12:09:02 2008 New Revision: 619135 URL: http://svn.apache.org/viewvc?rev=619135&view=rev Log: IO-140 JDK 1.5 changes: Add new JDK 1.5 methods
Modified: commons/proper/io/trunk/src/java/org/apache/commons/io/input/ProxyReader.java commons/proper/io/trunk/src/java/org/apache/commons/io/output/NullWriter.java commons/proper/io/trunk/src/java/org/apache/commons/io/output/ProxyWriter.java Modified: commons/proper/io/trunk/src/java/org/apache/commons/io/input/ProxyReader.java URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/src/java/org/apache/commons/io/input/ProxyReader.java?rev=619135&r1=619134&r2=619135&view=diff ============================================================================== --- commons/proper/io/trunk/src/java/org/apache/commons/io/input/ProxyReader.java (original) +++ commons/proper/io/trunk/src/java/org/apache/commons/io/input/ProxyReader.java Wed Feb 6 12:09:02 2008 @@ -19,6 +19,7 @@ import java.io.FilterReader; import java.io.IOException; import java.io.Reader; +import java.nio.CharBuffer; /** * A Proxy stream which acts as expected, that is it passes the method @@ -73,6 +74,17 @@ */ public int read(char[] chr, int st, int end) throws IOException { return in.read(chr, st, end); + } + + /** + * Invokes the delegate's <code>read(CharBuffer)</code> method. + * @param target the char buffer to read the characters into + * @return the number of characters read or -1 if the end of stream + * @throws IOException if an I/O error occurs + * @since IO 2.0 + */ + public int read(CharBuffer target) throws IOException { + return in.read(target); } /** Modified: commons/proper/io/trunk/src/java/org/apache/commons/io/output/NullWriter.java URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/src/java/org/apache/commons/io/output/NullWriter.java?rev=619135&r1=619134&r2=619135&view=diff ============================================================================== --- commons/proper/io/trunk/src/java/org/apache/commons/io/output/NullWriter.java (original) +++ commons/proper/io/trunk/src/java/org/apache/commons/io/output/NullWriter.java Wed Feb 6 12:09:02 2008 @@ -41,6 +41,38 @@ /** * Does nothing - output to <code>/dev/null</code>. + * @param c The character to write + * @sinc IO 2.0 + */ + public Writer append(char c) { + //to /dev/null + return this; + } + + /** + * Does nothing - output to <code>/dev/null</code>. + * @param csq The character sequence to write + * @param start The index of the first character to write + * @param end The index of the first character to write (exclusive) + * @sinc IO 2.0 + */ + public Writer append(CharSequence csq, int start, int end) { + //to /dev/null + return this; + } + + /** + * Does nothing - output to <code>/dev/null</code>. + * @param csq The character sequence to write + * @sinc IO 2.0 + */ + public Writer append(CharSequence csq) { + //to /dev/null + return this; + } + + /** + * Does nothing - output to <code>/dev/null</code>. * @param idx The character to write */ public void write(int idx) { Modified: commons/proper/io/trunk/src/java/org/apache/commons/io/output/ProxyWriter.java URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/src/java/org/apache/commons/io/output/ProxyWriter.java?rev=619135&r1=619134&r2=619135&view=diff ============================================================================== --- commons/proper/io/trunk/src/java/org/apache/commons/io/output/ProxyWriter.java (original) +++ commons/proper/io/trunk/src/java/org/apache/commons/io/output/ProxyWriter.java Wed Feb 6 12:09:02 2008 @@ -44,6 +44,38 @@ } /** + * Invokes the delegate's <code>append(char)</code> method. + * @param c The character to write + * @sinc IO 2.0 + */ + public Writer append(char c) throws IOException { + out.append(c); + return this; + } + + /** + * Invokes the delegate's <code>append(CharSequence, int, int)</code> method. + * @param csq The character sequence to write + * @param start The index of the first character to write + * @param end The index of the first character to write (exclusive) + * @sinc IO 2.0 + */ + public Writer append(CharSequence csq, int start, int end) throws IOException { + out.append(csq, start, end); + return this; + } + + /** + * Invokes the delegate's <code>append(CharSequence)</code> method. + * @param csq The character sequence to write + * @sinc IO 2.0 + */ + public Writer append(CharSequence csq) throws IOException { + out.append(csq); + return this; + } + + /** * Invokes the delegate's <code>write(int)</code> method. * @param idx the character to write * @throws IOException if an I/O error occurs