gnu.mapping
Class CharArrayOutPort
public
class
CharArrayOutPort
extends OutPort
Similar to CharArrayWriter.
Method Summary |
void | close() Do nothing.
|
protected boolean | closeOnExit() No point in registering this port with a WriterManager. |
int | length() |
void | reset() |
void | setLength(int length) |
char[] | toCharArray() Returns the written data as a freshly copied {@code char} array. |
String | toString() Returns the written data as a new {@code String}. |
String | toSubString(int beginIndex, int endIndex) Returns a substring of the written data as a new {@code String}.
|
String | toSubString(int beginIndex) Returns a substring of the written data as a new {@code String}.
|
void | writeTo(Consumer out) |
void | writeTo(int start, int count, Consumer out) |
public CharArrayOutPort()
public void close()
Do nothing.
This allows access to the buffer after the port is closed.
Not clear whether this is a good or bad idea, but it matches
ByteArrayOutputStream, CharArrayWriter, and StringWriter.
protected boolean closeOnExit()
No point in registering this port with a WriterManager.
public int length()
public void reset()
public void setLength(int length)
public char[] toCharArray()
Returns the written data as a freshly copied {@code char} array.
public String toString()
Returns the written data as a new {@code String}.
public String toSubString(int beginIndex, int endIndex)
Returns a substring of the written data as a new {@code String}.
Equivalent to {@code toString().substring(beginIndex, endIndex)}
but more efficient.
public String toSubString(int beginIndex)
Returns a substring of the written data as a new {@code String}.
Equivalent to {@code toString().substring(beginIndex)}
but more efficient.
public void writeTo(int start, int count,
Consumer out)