|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.io.InputStream java.io.FilterInputStream org.talika.tarsis.filters.upload.MultipartInputStream
public final class MultipartInputStream
Defines a specialiced InputStream
to process a multipart stream.
It provides two specialiced methods, readLine and readData.
Field Summary |
---|
Fields inherited from class java.io.FilterInputStream |
---|
in |
Constructor Summary | |
---|---|
MultipartInputStream(java.io.InputStream in,
java.lang.String boundary,
java.lang.String encoding)
Creates a new MultipartInputStream . |
Method Summary | |
---|---|
int |
read()
Reads the next byte of data from the input stream. |
int |
read(byte[] buffer,
int off,
int len)
Reads up to len bytes of data from the input stream into an array
of bytes. |
int |
readData(byte[] buffer,
int off,
int len)
Reads up to len bytes of data from the input stream into an array
of bytes. |
java.lang.String |
readLine()
Read a line of text. |
java.lang.String |
readLine(java.lang.String encoding)
Read a line of text using given encoding. |
Methods inherited from class java.io.FilterInputStream |
---|
available, close, mark, markSupported, read, reset, skip |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MultipartInputStream(java.io.InputStream in, java.lang.String boundary, java.lang.String encoding) throws java.io.IOException
MultipartInputStream
.
in
- InputStream the input stream from which bytes will be read.boundary
- String boundary of multipart.encoding
- String encoding of multipart.
java.io.IOException
- if an I/O error occurs.Method Detail |
---|
public int read(byte[] buffer, int off, int len) throws java.io.IOException
len
bytes of data from the input stream into an array
of bytes. An attempt is made to read as many as len
bytes, but a
smaller number may be read, possibly zero. The number of bytes actually read
is returned as an integer.
read
in class java.io.FilterInputStream
buffer
- byte[] the buffer into which the data is read.off
- int the start offset in array b at which the data is written.len
- int the maximum number of bytes to read.
-1
if there is no more data because the end of the stream has been reached.
java.io.IOException
- if an I/O error occurs.public int read() throws java.io.IOException
0
to 255
. If no byte is
available because the end of the stream has been reached, the value
-1
is returned. This method blocks until input data is available,
the end of the stream is detected, or an exception is thrown.
read
in class java.io.FilterInputStream
-1
if the end of the stream
is reached.
java.io.IOException
- if an I/O error occurs.public java.lang.String readLine() throws java.io.IOException
null
if the end of the stream has
been reached.
java.io.IOException
- if an I/O error occurs.public java.lang.String readLine(java.lang.String encoding) throws java.io.IOException
encoding
- String charset encoding.
null
if the end of the stream has
been reached.
java.io.IOException
- if an I/O error occurs.public int readData(byte[] buffer, int off, int len) throws java.io.IOException
len
bytes of data from the input stream into an array
of bytes. An attempt is made to read as many as len
bytes, but a
smaller number may be read, possibly zero. The number of bytes actually read
is returned as an integer.
buffer
- byte[] the buffer into which the data is read.off
- int the start offset in array b at which the data is written.len
- int the maximum number of bytes to read.
-1
if there is no more data because the end of the stream has been reached.
java.io.IOException
- if an I/O error occurs.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |