OutputStreamStringCollector
instead@Deprecated public class OutputStreamStringCollector extends java.lang.Object implements java.lang.AutoCloseable, StringCollector
Usually should be closed after usage. Recommend is to use it in try-with-resources-
Modifier and Type | Field and Description |
---|---|
static java.nio.charset.Charset |
DEFAULT_CHARSET
Deprecated.
The default charset (UTF_8).
|
Constructor and Description |
---|
OutputStreamStringCollector(java.io.OutputStream stream)
Deprecated.
Constructor.
|
OutputStreamStringCollector(java.io.OutputStream stream,
java.nio.charset.Charset charset)
Deprecated.
Constructor.
|
OutputStreamStringCollector(java.io.OutputStream stream,
java.lang.String charsetName)
Deprecated.
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
add(char ch)
Deprecated.
Add a character to this collector.
|
void |
add(java.lang.String str)
Deprecated.
Add a string t this collector.
|
void |
close()
Deprecated.
Closes this stream and releases any system resources associated
with it.
|
java.io.IOException |
getError()
Deprecated.
Get a possible error.
|
char |
getLastLetter()
Deprecated.
Get the last letter of the last string which was added.
|
void |
rethrow()
Deprecated.
Rethrow an error which was caught during writing of added strings.
|
public static final java.nio.charset.Charset DEFAULT_CHARSET
public OutputStreamStringCollector(@NotNull java.io.OutputStream stream)
DEFAULT_CHARSET
for output encoding.stream
- output streampublic OutputStreamStringCollector(@NotNull java.io.OutputStream stream, @NotNull java.lang.String charsetName)
stream
- output streamcharsetName
- name of charset to use for output encodingpublic void add(@NotNull java.lang.String str)
add
in interface StringCollector
str
- string collectorpublic void add(char ch)
add
in interface StringCollector
ch
- character to addpublic char getLastLetter()
getLastLetter
in interface StringCollector
public void close() throws java.io.IOException
close
in interface java.lang.AutoCloseable
java.io.IOException
- if an I/O error occurspublic void rethrow() throws java.io.IOException
java.io.IOException
- exception caught during writing strings@Nullable public java.io.IOException getError()