You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@abdera.apache.org by jm...@apache.org on 2006/07/15 18:41:42 UTC

svn commit: r422263 - /incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/util/PeekAheadInputStream.java

Author: jmsnell
Date: Sat Jul 15 09:41:42 2006
New Revision: 422263

URL: http://svn.apache.org/viewvc?rev=422263&view=rev
Log:
More wierdness with the PushbackInputStream.  If we don't call available() within read(byte[],int,int), the amount of bytes
read off some streams may be incorrect, which leads to an incorrect pushback, breaking the xml parse.

Modified:
    incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/util/PeekAheadInputStream.java

Modified: incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/util/PeekAheadInputStream.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/util/PeekAheadInputStream.java?rev=422263&r1=422262&r2=422263&view=diff
==============================================================================
--- incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/util/PeekAheadInputStream.java (original)
+++ incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/util/PeekAheadInputStream.java Sat Jul 15 09:41:42 2006
@@ -122,6 +122,7 @@
 
   @Override
   public int read(byte[] b, int off, int len) throws IOException {
+    this.available(); // workaround for a problem in PushbackInputStream, without this, the amount of bytes read from some streams will be incorrect
     int r = super.read(b, off, len);
     if (pos >= buf.length && buf.length > origsize) shrink();
     return r;