*) reusing buffer instead of creating a new one

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@239 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
theli 20 years ago
parent a566588e9b
commit aae3e3b7ab

@ -306,7 +306,8 @@ public final class htmlFilterOutputStream extends OutputStream {
// the tag ends here. after filtering: pass on // the tag ends here. after filtering: pass on
filtered = filterSentence(buffer.getBytes(), singlequote); filtered = filterSentence(buffer.getBytes(), singlequote);
if (out != null) out.write(filtered); if (out != null) out.write(filtered);
buffer = new serverByteBuffer(); // buffer = new serverByteBuffer();
buffer.reset();
} }
} else if (inDoubleQuote) { } else if (inDoubleQuote) {
buffer.append(b); buffer.append(b);
@ -317,7 +318,8 @@ public final class htmlFilterOutputStream extends OutputStream {
// the tag ends here. after filtering: pass on // the tag ends here. after filtering: pass on
filtered = filterSentence(buffer.getBytes(), doublequote); filtered = filterSentence(buffer.getBytes(), doublequote);
if (out != null) out.write(filtered); if (out != null) out.write(filtered);
buffer = new serverByteBuffer(); // buffer = new serverByteBuffer();
buffer.reset();
} }
} else if (inComment) { } else if (inComment) {
buffer.append(b); buffer.append(b);
@ -326,7 +328,8 @@ public final class htmlFilterOutputStream extends OutputStream {
// comment is at end // comment is at end
inComment = false; inComment = false;
if (out != null) out.write(buffer.getBytes()); if (out != null) out.write(buffer.getBytes());
buffer = new serverByteBuffer(); // buffer = new serverByteBuffer();
buffer.reset();
} }
} else if (inScript) { } else if (inScript) {
buffer.append(b); buffer.append(b);
@ -342,7 +345,8 @@ public final class htmlFilterOutputStream extends OutputStream {
// script is at end // script is at end
inScript = false; inScript = false;
if (out != null) out.write(buffer.getBytes()); if (out != null) out.write(buffer.getBytes());
buffer = new serverByteBuffer(); // buffer = new serverByteBuffer();
buffer.reset();
} }
} else { } else {
if (buffer.length() == 0) { if (buffer.length() == 0) {
@ -376,7 +380,8 @@ public final class htmlFilterOutputStream extends OutputStream {
// the tag ends here. after filtering: pass on // the tag ends here. after filtering: pass on
filtered = filterSentence(buffer.getBytes(), doublequote); filtered = filterSentence(buffer.getBytes(), doublequote);
if (out != null) out.write(filtered); if (out != null) out.write(filtered);
buffer = new serverByteBuffer(); // buffer = new serverByteBuffer();
buffer.reset();
} else if (b == lb) { } else if (b == lb) {
// this is an error case // this is an error case
// we consider that there is one rb missing // we consider that there is one rb missing
@ -384,7 +389,8 @@ public final class htmlFilterOutputStream extends OutputStream {
filtered = filterSentence(buffer.getBytes(), doublequote); filtered = filterSentence(buffer.getBytes(), doublequote);
if (out != null) out.write(filtered); if (out != null) out.write(filtered);
} }
buffer = new serverByteBuffer(); // buffer = new serverByteBuffer();
buffer.reset();
buffer.append(b); buffer.append(b);
} else { } else {
buffer.append(b); buffer.append(b);
@ -397,7 +403,8 @@ public final class htmlFilterOutputStream extends OutputStream {
filtered = filterSentence(buffer.getBytes(), doublequote); filtered = filterSentence(buffer.getBytes(), doublequote);
if (out != null) out.write(filtered); if (out != null) out.write(filtered);
} }
buffer = new serverByteBuffer(); // buffer = new serverByteBuffer();
buffer.reset();
buffer.append(b); buffer.append(b);
} else { } else {
// simply append // simply append

Loading…
Cancel
Save