Resin 1.1
FAQ
Reference
JavaDoc
Demo
Java Tutorial
Getting Started
Configuration
Topics
JSP
XTP/XSL
JavaScript
JS Library
Core Library
File Library
Servlet Library
Database Library
XML Library
VFS
File
ReadStream
WriteStream
InputStream
OutputStream
Read Streams
Resin Stream instances are roughly comparable to a combination of the Java `InputStream` and `Reader` classes, or to put it another way. Read streams inherit from `InputStream`, so you can pass them to Java methods expecing `InputStreams`. Stream instances are always buffered.
Read Stream instance properties
readByte() | Reads a single byte from the stream and returns it as a number. It returns -1 on end of file.
read([n]) | Reads n characters from the stream and returns them as a string. If n is omitted, reads a single character.
readln() | Reads a line from the stream and returns a string. Lines are delimited by a linefeed ('\n').
available() | This function returns the bytes available to be read.
position | The position in the file counted as bytes from the beginning of the file.
inputStream | Returns a JDK InputStream tied to this stream.
close() | Closes the stream.
Read Stream instance properties | Resin 1.0
### readByte()
Reads a single byte from the stream and returns it as a number. It returns -1 on end of file.
### read([n])
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.
### readln()
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.
### available()
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.
### position
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.
### inputStream
Returns a JDK InputStream tied to this stream.
### close()
Closes the stream.
File |  | WriteStream
Copyright © 1998-2000 Caucho Technology. All rights reserved. Last modified: Mon, 03 Apr 2000 11:20:13 -0700 (PDT)