abdera-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jmsn...@apache.org
Subject svn commit: r421317 - /incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/SniffingInputStream.java
Date Wed, 12 Jul 2006 16:47:02 GMT
Author: jmsnell
Date: Wed Jul 12 09:47:02 2006
New Revision: 421317

URL: http://svn.apache.org/viewvc?rev=421317&view=rev
Log:
Ok. it appears to be working consistently now.  I'll be checking in a number of test cases
later today or tomorrow that 
test the sniffer and ensure that things continue to just work.

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

Modified: incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/SniffingInputStream.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/SniffingInputStream.java?rev=421317&r1=421316&r2=421317&view=diff
==============================================================================
--- incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/SniffingInputStream.java
(original)
+++ incubator/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/SniffingInputStream.java
Wed Jul 12 09:47:02 2006
@@ -36,7 +36,7 @@
   private boolean bomset = false;
   
   public SniffingInputStream(InputStream in) {
-    super(new BufferedInputStream(in,4));
+    super(new BufferedInputStream(in));
     try {
       encoding = detectEncoding();
     } catch (IOException e) {}
@@ -88,7 +88,6 @@
       charset = "edbdic";
     } 
     bomset = false;
-    pin.mark(pin.available());
     try {
       XMLStreamReader xmlreader = 
         XMLInputFactory.newInstance().createXMLStreamReader(pin);
@@ -96,7 +95,11 @@
       if (cs != null) charset = cs;
     } catch (Exception e) {
     } finally {
-      pin.reset();
+      try {
+        pin.reset();
+      } catch (Exception ex) {
+        ex.printStackTrace();
+      }
     }
     return charset;
   }



Mime
View raw message