Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,26 @@
* @since 0.1.0
*/
class FastStringWriter extends Writer {

/**
* buffer size for StrBuilder.
*/
private static final int BUFFER_SIZE;

static {
int value;
try {
value = Integer.parseInt(System.getProperty("hbs.buffer", "1600"));
} catch (Throwable e) {
value = 1600;
}
BUFFER_SIZE = value;
}

/**
* The internal buffer.
*/
private StrBuilder buffer = new StrBuilder(Integer
.parseInt(System.getProperty("hbs.buffer", "1600")));
private StrBuilder buffer = new StrBuilder(BUFFER_SIZE);

@Override
public Writer append(final char c) throws IOException {
Expand Down