org.apache.struts.upload
class MultipartValueStream extends InputStream
Deprecated: Use the Commons FileUpload based multipart handler instead. This class will be removed after Struts 1.2.
This class implements an inputStream that reads another stream until a multipart boundary is found. The class reports eof when boundary found. The undelying stream is not closed.See RFC 1867 (http://info.internet.isi.edu:80/in-notes/rfc/files/rfc1867.txt) for details about the protocol.
Field Summary | |
---|---|
byte[] | boundaryBytes byte buffer with the boundary |
boolean | boundaryReached have we reached the boundary? |
boolean | finalBoundaryReached is the boundary found a final boundary? |
static String | HEADER_ENCODING |
InputStream | in the underlying stream |
int | matchedBoundaryBytes how many curretly matched boundary bytes? |
int | readAheadBufferEndI The end index for the read ahead cyclic buffer (points to the last byte) |
int | readAheadBufferStartI The start index for the read ahead cyclic buffer (points to the first byte) |
byte[] | readAheadBytes the read ahead buffer (cyclic) |
Constructor Summary | |
---|---|
MultipartValueStream(InputStream in, String boundary)
Create a stream that stops reading at the boundary
NOTE: the boundary parameter is without the trailing dashes "--". |
Method Summary | |
---|---|
boolean | encounteredFinalBoundary() |
int | read()
Read the next byte
|
Returns: true if we are the last stream, ie. we encountered a final boundary false otherwise
Throws: ServletException if the boundary has not yet been reached
Returns: -1 on boundary reached
Throws: IOException if the ending boundary is never found