Skip to content

Commit

Permalink
in-tb-usfm: Set input buffer size
Browse files Browse the repository at this point in the history
  • Loading branch information
yukuku committed Oct 3, 2012
1 parent 1d5af55 commit f6ea4f3
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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());
Expand Down

0 comments on commit f6ea4f3

Please sign in to comment.