diff --git a/source/net/yacy/document/parser/html/TransformerWriter.java b/source/net/yacy/document/parser/html/TransformerWriter.java index 8a6446a6a..dd2e7a4a4 100644 --- a/source/net/yacy/document/parser/html/TransformerWriter.java +++ b/source/net/yacy/document/parser/html/TransformerWriter.java @@ -81,11 +81,22 @@ public final class TransformerWriter extends Writer { final Scraper scraper, final Transformer transformer, final boolean passbyIfBinarySuspect + ) { + this(outStream, charSet, scraper, transformer, passbyIfBinarySuspect, 1024); + } + + public TransformerWriter( + final OutputStream outStream, + final Charset charSet, + final Scraper scraper, + final Transformer transformer, + final boolean passbyIfBinarySuspect, + final int initialBufferSize ) { this.outStream = outStream; this.scraper = scraper; this.transformer = transformer; - this.buffer = new CharBuffer(1024); + this.buffer = new CharBuffer(initialBufferSize); this.filterTag = null; this.filterOpts = null; this.filterCont = null; diff --git a/source/net/yacy/document/parser/htmlParser.java b/source/net/yacy/document/parser/htmlParser.java index 69c9f078d..0f9b839f0 100644 --- a/source/net/yacy/document/parser/htmlParser.java +++ b/source/net/yacy/document/parser/htmlParser.java @@ -196,7 +196,7 @@ public class htmlParser extends AbstractParser implements Parser { // parsing the content final ContentScraper scraper = new ContentScraper(location); - final TransformerWriter writer = new TransformerWriter(null,null,scraper,null,false); + final TransformerWriter writer = new TransformerWriter(null,null,scraper,null,false, sourceStream.available()); try { FileUtils.copy(sourceStream, writer, c); } catch (final IOException e) {