Servlet::ServletInputStream - servlet input stream interface
my $byte = $stream->read();
my $numbytes = $stream->read(\$buffer); my $numbytes = $stream->read(\$buffer, $offset, $length);
my $numbytes = $stream->readLine(\$buffer, $offset, $length);
$stream->skip($numbytes);
if ($stream->markSupported()) { $stream->mark($limit); $stream->reset(); }
$stream->close();
Provides an input stream for reading binary data from a client request. With some protocols, such as HTTP POST and PUT, the stream can be used to read data sent from the client.
An input stream object is normally retrieved via getInputStream in the Servlet::ServletRequest manpage.
NOTE: While this is an abstract class in the Java API, the Perl API provides it as an interface. The main difference is that the Perl version has no constructor. Also, it merges the methods declared in java.io.InputStream and javax.servlet.ServletInputStream into a single interface.
close()
Throws:
mark($limit)
reset()
repositions the stream at the last marked position so that
subsequent reads re-read the same bytes.
The $limit argument tells the stream to allow that many bytes to be
read before the mark position is invalidated. If more than $limit
bytes are read, a call to reset()
will have no effect.
Parameters:
Throws:
markSupported()
mark()
and reset()
, or false
if it does not.
read()
If arguments are specified, reads up to $length bytes from the stream, stores them in $buffer, and returns the number of bytes read (or undef if no bytes are available because the end of the stream has been reached).
If $offset is specified, the read data is placed $offset bytes from the beginning of $buffer. If $offset is negative, it will be counted backwardsd from the end of the string. If $offset is positive and greater than the length of $buffer, the scalar will be padded to the required size with ``\0'' bytes before the result of the read is appended.
Blocks until input data is available, the end of the stream is detected, or an exception is thrown.
Parameters:
Throws:
Parameters:
Throws:
mark()
was last
called on the stream.
Throws:
skip($num)
Parameters:
Throws:
the Servlet::ServletRequest manpage, the Servlet::Util::Exception manpage
Brian Moseley, bcm@maz.org