tika-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ridabenjell...@apache.org
Subject svn commit: r580362 - /incubator/tika/trunk/src/main/java/org/apache/tika/parser/txt/TXTParser.java
Date Fri, 28 Sep 2007 14:10:39 GMT
Author: ridabenjelloun
Date: Fri Sep 28 07:10:39 2007
New Revision: 580362

URL: http://svn.apache.org/viewvc?rev=580362&view=rev
Log:
Tika-38. TXTParser Keith contribution

Modified:
    incubator/tika/trunk/src/main/java/org/apache/tika/parser/txt/TXTParser.java

Modified: incubator/tika/trunk/src/main/java/org/apache/tika/parser/txt/TXTParser.java
URL: http://svn.apache.org/viewvc/incubator/tika/trunk/src/main/java/org/apache/tika/parser/txt/TXTParser.java?rev=580362&r1=580361&r2=580362&view=diff
==============================================================================
--- incubator/tika/trunk/src/main/java/org/apache/tika/parser/txt/TXTParser.java (original)
+++ incubator/tika/trunk/src/main/java/org/apache/tika/parser/txt/TXTParser.java Fri Sep 28
07:10:39 2007
@@ -32,13 +32,15 @@
 
     protected String parse(InputStream stream, Iterable<Content> contents)
             throws IOException, TikaException {
-        StringBuffer sb = new StringBuffer();
+        StringBuilder sb = new StringBuilder();
         BufferedReader br = new BufferedReader(new InputStreamReader(stream));
-        String line = null;
-        while ((line = br.readLine()) != null) {
-            sb.append(line);
-            sb.append(" ");
+
+        int charAsInt;
+
+        while ((charAsInt = br.read()) != -1) {
+            sb.append((char) charAsInt);
         }
+
         return sb.toString();
     }
 



Mime
View raw message