Contents | Package | Class | Tree | Deprecated | Index | Help Java 1.2 Beta 3
PREV | NEXT SHOW LISTS | HIDE LISTS

Class javax.servlet.ServletInputStream

java.lang.Object
    |
    +----java.io.InputStream
            |
            +----javax.servlet.ServletInputStream

public abstract class ServletInputStream
extends InputStream
An input stream for reading servlet requests, it provides an efficient readLine method. This is an abstract class, to be implemented by a network services writer. For some application protocols, such as the HTTP POST and PUT methods, servlet writers use the input stream to get data from clients. They access the input stream via the ServletRequest's getInputStream method, available from within the servlet's service method. Subclasses of ServletInputStream must provide an implementation of the read() method.

See Also:
read()

Constructor Summary
 ServletInputStream()
The default constructor does no work.
 

Method Summary
int  readLine(byte[] b, int off, int len)
Starting at the specified offset, reads into the given array of bytes until all requested bytes have been read or a '\n' is encountered, in which case the '\n' is read into the array as well.
 
Methods inherited from class java.io.InputStream
 available, close, mark, markSupported, read, read, read, reset, skip
 
Methods inherited from class java.lang.Object
 clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ServletInputStream

protected ServletInputStream()
The default constructor does no work.
Method Detail

readLine

public int readLine(byte[] b,
                    int off,
                    int len) throws IOException
Starting at the specified offset, reads into the given array of bytes until all requested bytes have been read or a '\n' is encountered, in which case the '\n' is read into the array as well.
Parameters:
b - the buffer into which the data is read
off - the start offset of the data
len - the maximum number of bytes to read
Returns:
the actual number of bytes read, or -1 if the end of the stream is reached
Throws:
IOException - if an I/O error has occurred

Contents | Package | Class | Tree | Deprecated | Index | Help Java 1.2 Beta 3
PREV | NEXT SHOW LISTS | HIDE LISTS

Submit a bug or feature
Submit comments/suggestions about new javadoc look.
Java is a trademark or registered trademark of Sun Microsystems, Inc. in the US and other countries.
Copyright 1993-1998 Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, California, 94303, U.S.A. All Rights Reserved.