StringInputStream Interface
A string input stream wraps a basic input stream and supplies string data. This data can be read either as string chunks or as lines separated by line termination character sequences.
Constructors
Code new StringInputStream(InputStream input, [Encoding encoding]) #
Decodes a binary input stream into characters using the specified
encoding. The default encoding is UTF-8 - Encoding.UTF_8
.
StringInputStream(InputStream input, [Encoding encoding]);
Methods
Code int available() #
Returns the number of characters available for immediate reading. Note that this includes all characters that will be in the String returned from read this includes line breaking characters. If readLine is used for reading one can observe less characters being returned as the line breaking characters are discarded.
int available();
Code bool get closed() #
Returns whether the stream has been closed. There might still be more data to read.
bool get closed();
Code Encoding get encoding() #
Returns the encoding used to decode the binary data into characters.
Encoding get encoding();
Code void set onClosed(void callback()) #
Sets the handler that gets called when there will be no more data available in the stream.
void set onClosed(void callback());
Code void set onData(void callback()) #
Code void set onError(void callback(e)) #
Sets the handler that gets called when the underlying communication channel gets into some kind of error situation.
void set onError(void callback(e));