|
![]() |
![]() Resin Stream instances are roughly comparable to a combination of the Java RandomAccessFile , Reader and Writer
classes, or to put it another way, to the C language's FILE object.
Stream instances are always buffered.
Reads a single byte from the stream and returns it as a number.
It returns -1 on end of file.
Reads n characters from the stream and returns them as a string. If n is
omitted, reads a single character.
It returns null on end of file.
Reads a line from the stream and returns a string. Lines are
delimited by a linefeed ('\n'). The trailing cr-lf is stripped from
the string.
Returns null on end of file.
This function returns the bytes available to be
read. The only guarantee is that if there are bytes to be read
available will be non-zero.
The position in the file counted as bytes from the beginning of the
file. Reading it will return the current position and writing to it
will set the position.
For some streams, like standard input, standard output and tcp/ip streams this returns a read-only value of 0.
Returns a JDK InputStream tied to this stream.
Writes the byte to the stream.
Writes the string to the stream.
Writes the string to the stream, appending a newline.
Writes formatted output to the stream. Resin's printf function follows C's.
Writes the entire contents of
to the stream.
Writes the entire contents of the File object
to the stream.
The following example writes the home page of caucho.com to out.
Returns a JDK OutputStream tied to the stream.
Flushes output to the stream.
Closes the stream.
|