WriteStream instances are roughly comparable to a combination of the
Java OutputStream and Writer classes.
Write streams inherit from WriteStream , so you can pass them to
Java methods expecing WriteStreams .
Stream instances are always buffered.
Write Stream instance properties
|
writeByte(b) |
Writes the byte to the stream. |
write(string) |
Writes the string to the stream. |
writeln(string) |
Writes the string to the stream, appending a newline. |
printf(fmt, ...) |
Writes formatted output to the stream. |
writeStream(stream) |
Writes the entire contents of stream to the stream. |
writeFile(file) |
Writes the entire contents of the File object file to the stream. |
outputStream |
Returns a JDK OutputStream tied to the stream.
|
flush() |
Flushes output to the stream.
|
close() |
Closes the stream.
|
Write Stream instance properties
| Resin 1.0 |
Writes the byte to the stream.
Writes the string to the stream.
out.write("2 + 2 = ", 2 + 2)
out.writeln("; 4 + 4 = ", 4 + 4)
|
2 + 2 = 4; 4 + 4 = 8
|
Writes the string to the stream, appending a newline.
out.writeln("2 + 2 = ", 2 + 2)
out.writeln("4 + 4 = ", 4 + 4)
|
2 + 2 = 4
4 + 4 = 8
|
Writes formatted output to the stream. Resin's printf function follows C's.
Writes the entire contents of stream to the stream.
Writes the entire contents of the File object file to the stream.
writeFile opens the file object file as in openRead .
It copies the entire contents of file to the stream as
writeStream . Finally, it closes the stream.
The following example writes the home page of caucho.com to out.
out.writeFile(File("http://www.caucho.com"))
|
Flushes output to the stream.
Closes the stream.
Copyright © 1998-2000 Caucho Technology. All rights reserved.
Last modified: Fri, 31 Mar 2000 18:56:16 -0800 (PST)
|