Permalink
Browse files

in-tb-usfm: Set input buffer size

  • Loading branch information...
1 parent 1d5af55 commit f6ea4f365f25b9aef28d02075546d56e203f3a28 @yukuku committed Oct 3, 2012
Showing with 6 additions and 1 deletion.
  1. +6 −1 AlkitabConverter/src/yuku/alkitabconverter/in_tb_usfm/Proses2.java
@@ -14,6 +14,7 @@
import org.xml.sax.Attributes;
import org.xml.sax.SAXException;
+import org.xml.sax.XMLReader;
import org.xml.sax.ext.DefaultHandler2;
import yuku.alkitab.yes.YesFile;
@@ -71,7 +72,11 @@ public void u() throws Exception {
FileInputStream in = new FileInputStream(new File(INPUT_TEKS_2, file));
SAXParser parser = factory.newSAXParser();
- parser.getXMLReader().setFeature("http://xml.org/sax/features/namespaces", true);
+ XMLReader r = parser.getXMLReader();
+ System.out.println("input buffer size (old) = " + r.getProperty("http://apache.org/xml/properties/input-buffer-size"));
+ r.setProperty("http://apache.org/xml/properties/input-buffer-size", 1048576);
+ System.out.println("input buffer size (new) = " + r.getProperty("http://apache.org/xml/properties/input-buffer-size"));
+ r.setFeature("http://xml.org/sax/features/namespaces", true);
parser.parse(in, new Handler(Integer.parseInt(file.substring(0, 2))));
System.out.println("file " + file + " done; now total rec: " + teksDb.size());

0 comments on commit f6ea4f3

Please sign in to comment.