abdera-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jmsn...@apache.org
Subject svn commit: r422263 - /incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/util/PeekAheadInputStream.java
Date Sat, 15 Jul 2006 16:41:42 GMT
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;



Mime
View raw message