org.apache.struts.upload
Class MultipartValueStream
InputStream
org.apache.struts.upload.MultipartValueStream
(package private) class MultipartValueStream
extends InputStream
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.
MultipartValueStream(InputStream in, String boundary) - Create a stream that stops reading at the boundary
NOTE: the boundary parameter is without the trailing dashes "--".
|
HEADER_ENCODING
public static final String HEADER_ENCODING
boundaryBytes
private byte[] boundaryBytes
byte buffer with the boundary
boundaryReached
private boolean boundaryReached
have we reached the boundary?
finalBoundaryReached
private boolean finalBoundaryReached
is the boundary found a final boundary?
in
private InputStream in
the underlying stream
matchedBoundaryBytes
private int matchedBoundaryBytes
how many curretly matched boundary bytes?
readAheadBufferEndI
private int readAheadBufferEndI
The end index for the read ahead cyclic buffer (points to the last byte)
readAheadBufferStartI
private int readAheadBufferStartI
The start index for the read ahead cyclic buffer (points to the first byte)
readAheadBytes
private byte[] readAheadBytes
the read ahead buffer (cyclic)
MultipartValueStream
public MultipartValueStream(InputStream in,
String boundary)
throws IOException
Create a stream that stops reading at the boundary
NOTE: the boundary parameter is without the trailing dashes "--".
encounteredFinalBoundary
public boolean encounteredFinalBoundary()
throws ServletException
- true if we are the last stream, ie. we encountered a final boundary
read
public int read()
throws IOException
Read the next byte
Copyright B) 2000-2007 - The Apache Software Foundation