Datatype representing an input stream of bytes.
Methods
Returns number of bytes available from this stream
without blocking.
| Throws |
IOError -
If an I/O error occurs.
|
Closes this input stream and releases any system resources associated with the stream.
| Throws |
IOError -
If an I/O error occurs.
|
Gets the current column number of this stream.
Useful only with text content.
Gets the current line number of this stream.
Useful only with text content.
int read()
Reads a single byte from stream.
string read(
int maxBytes)
Reads upto given
amount of bytes from stream.
Reads bytes from stream.
| Returns |
Byte read, or bytes read as string, or null
if end of stream has been reached. |
| Throws |
IOError -
If an I/O error occurs.
|
Reads bytes from stream.
| Parameters |
array -
The binary into which the data is written
offset -
The start offset in binary
length -
The maximum number of bytes to read.
|
| Returns |
Number of bytes read, or -1 if end of stream has been
reached. |
| Throws |
IOError -
If an I/O error occurs.
|
Reads serialized data from this stream.
| Returns |
Unserialized data |
| Throws |
IOError -
If an I/O error occurs.
CorruptedSerialization -
If serialized data is corrupted
|
Reads single line from stream.
| Returns |
Line read or, null if end of stream was
reached. |
| Throws |
IOError -
If an I/O error occurs.
|
| Parameters |
maxLinex -
Maximum number of lines to return
|
| Returns |
Lines read as list of strings with linefeeds
stripped. |
| Throws |
IOError -
If an I/O error occurs.
|
Skips over some bytes in this stream.
| Parameters |
amount -
Amount of bytes to skip
|
| Returns |
Amount of bytes skipped, or -1 if end of stream was reached
before any bytes were skipped. |
| Throws |
IOError -
If an I/O error occurs.
|
Writes the contents of this stream to given OutputStream.
| Returns |
Amount of bytes written |
| Throws |
IOError -
If an I/O error occurs.
|
Operators
Returns iterator (of strings) that will read the stream
line-by-line.