Skip to content

Commit

Permalink
improve CharSequenceInputStream
Browse files Browse the repository at this point in the history
  • Loading branch information
sebthom committed Jun 24, 2024
1 parent 6119507 commit 520e04d
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import java.io.IOException;
import java.io.InputStream;
import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;

import net.sf.jstuff.core.io.IOUtils;

Expand All @@ -27,11 +26,11 @@ public class CharSequenceInputStream extends InputStream {
private int mark = -1;

public CharSequenceInputStream(final CharSequence input) {
this(input, Math.min(8196, input.length()), StandardCharsets.UTF_8);
this(input, Math.min(IOUtils.DEFAULT_BUFFER_SIZE, input.length() * 2), Charset.defaultCharset());
}

public CharSequenceInputStream(final CharSequence input, final int bufferSize) {
this(input, bufferSize, StandardCharsets.UTF_8);
this(input, bufferSize, Charset.defaultCharset());
}

public CharSequenceInputStream(final CharSequence input, final int bufferSize, final Charset charset) {
Expand Down

0 comments on commit 520e04d

Please sign in to comment.