diff options
author | Chris Bowditch <cbowditch@apache.org> | 2012-01-06 16:03:44 +0000 |
---|---|---|
committer | Chris Bowditch <cbowditch@apache.org> | 2012-01-06 16:03:44 +0000 |
commit | 0cc4cbb9f06fd9c1d8549fb17f501d24bd7b5976 (patch) | |
tree | 88a1639d1c298367420e842dd2602027eac0f00c /src/java/org/apache/fop/pdf/PDFRectangle.java | |
parent | 89eb2ae7a4f2e52db9a878d3b10b168cdbca87e7 (diff) | |
download | xmlgraphics-fop-0cc4cbb9f06fd9c1d8549fb17f501d24bd7b5976.tar.gz xmlgraphics-fop-0cc4cbb9f06fd9c1d8549fb17f501d24bd7b5976.zip |
Bugzilla #51644:
Tagged PDF performance improvement + tests
Submitted by: Mehdi Houshmand
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@1228243 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org/apache/fop/pdf/PDFRectangle.java')
-rw-r--r-- | src/java/org/apache/fop/pdf/PDFRectangle.java | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/src/java/org/apache/fop/pdf/PDFRectangle.java b/src/java/org/apache/fop/pdf/PDFRectangle.java index ce5b46440..30f218824 100644 --- a/src/java/org/apache/fop/pdf/PDFRectangle.java +++ b/src/java/org/apache/fop/pdf/PDFRectangle.java @@ -21,7 +21,6 @@ package org.apache.fop.pdf; import java.io.IOException; import java.io.OutputStream; -import java.io.Writer; /** * class representing a rectangle @@ -78,16 +77,26 @@ public class PDFRectangle implements PDFWritable { } private String format() { - return "[" + llx + " " + lly + " " + urx + " " + ury + "]"; + StringBuilder textBuffer = new StringBuilder(32); + format(textBuffer); + return textBuffer.toString(); + } + + private void format(StringBuilder textBuffer) { + textBuffer.append('[').append(llx) + .append(' ').append(lly) + .append(' ').append(urx) + .append(' ').append(ury).append(']'); } /** {@inheritDoc} */ + @Override public String toString() { return "PDFRectangle" + format(); } /** {@inheritDoc} */ - public void outputInline(OutputStream out, Writer writer) throws IOException { - writer.write(format()); + public void outputInline(OutputStream out, StringBuilder textBuffer) throws IOException { + format(textBuffer); } } |