Author: sebb Date: Thu Mar 22 20:58:01 2012 New Revision: 1304055 URL: http://svn.apache.org/viewvc?rev=1304055&view=rev Log: IO-312 CharSequenceInputStream(CharSequence s, Charset charset, int bufferSize) ignores bufferSize
Modified: commons/proper/io/trunk/src/changes/changes.xml commons/proper/io/trunk/src/main/java/org/apache/commons/io/input/CharSequenceInputStream.java Modified: commons/proper/io/trunk/src/changes/changes.xml URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/src/changes/changes.xml?rev=1304055&r1=1304054&r2=1304055&view=diff ============================================================================== --- commons/proper/io/trunk/src/changes/changes.xml (original) +++ commons/proper/io/trunk/src/changes/changes.xml Thu Mar 22 20:58:01 2012 @@ -39,7 +39,10 @@ The <action> type attribute can be add,u </properties> <body> - <release version="2.2" date="2012-03-18" description=""> + <release version="2.2" date="TBA" description=""> + <action issue="IO-312" dev="sebb" type="fix"> + CharSequenceInputStream(CharSequence s, Charset charset, int bufferSize) ignores bufferSize + </action> <action issue="IO-305" dev="sebb" type="add" due-to="Manoj Mokashi"> New copyLarge() method in IOUtils that takes additional offset, length arguments </action> Modified: commons/proper/io/trunk/src/main/java/org/apache/commons/io/input/CharSequenceInputStream.java URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/src/main/java/org/apache/commons/io/input/CharSequenceInputStream.java?rev=1304055&r1=1304054&r2=1304055&view=diff ============================================================================== --- commons/proper/io/trunk/src/main/java/org/apache/commons/io/input/CharSequenceInputStream.java (original) +++ commons/proper/io/trunk/src/main/java/org/apache/commons/io/input/CharSequenceInputStream.java Thu Mar 22 20:58:01 2012 @@ -55,7 +55,7 @@ public class CharSequenceInputStream ext this.encoder = charset.newEncoder() .onMalformedInput(CodingErrorAction.REPLACE) .onUnmappableCharacter(CodingErrorAction.REPLACE); - this.bbuf = ByteBuffer.allocate(124); + this.bbuf = ByteBuffer.allocate(bufferSize); this.bbuf.flip(); this.cbuf = CharBuffer.wrap(s); this.mark = -1; @@ -181,13 +181,17 @@ public class CharSequenceInputStream ext public void close() throws IOException { } + /** + * {@inheritDoc} + * @param readlimit max read limit (ignored) + */ @Override - public void mark(int readlimit) { + public synchronized void mark(@SuppressWarnings("unused") int readlimit) { this.mark = this.cbuf.position(); } @Override - public void reset() throws IOException { + public synchronized void reset() throws IOException { if (this.mark != -1) { this.cbuf.position(this.mark); this.mark = -1;