com.ibm.portal.resolver.streams
Class MultipartInputStream
java.lang.Object
java.io.InputStream
com.ibm.portal.resolver.streams.MultipartInputStream
- All Implemented Interfaces:
- MultipartStream, java.io.Closeable
public abstract class MultipartInputStream
- extends java.io.InputStream
- implements MultipartStream
Input stream that represents the content of a multipart stream following RFC
1521. This multipart stream consists of zero or more substreams that are each
separated via a boundary. The construction logic of the instance of
MultipartInputStream needs to take care that the correct boundary
value is specified. This boundary is typically defered from the content-type request header.
The caller can step over the multipart entries using the
getNextEntry() method. Calling this method returns a description of
the next entry or null
if no entry is available. In addition
the input stream will be reset to represent the content of the entry. This
content will already be decoded wtr to the
Content-Transfer-Encoding
header of the entry. Reading the
complete input stream until any of the read-method returns -1 will read up to
the end of the current entry.
The design of this abstract class has been modelled after
ZipInputStream.
Instances of MultipartInputStream can be created via the
com.ibm.portal.resolver.streams.StreamFactory.
- Since:
- 6.0.1
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
|
MultipartInputStream
public MultipartInputStream()
getNextEntry
public abstract MultipartStream.Entry getNextEntry()
throws java.io.IOException
Reads the next multipart stream entry and positions stream at the
beginning of the entry data. Note that Entry instances may be
recycled, the entry is only valid until the next call to
getNextEntry() or MultipartStream.closeEntry().
The implementation will at least interpret the following headers
automatically
- Content-Type: to implement the Entry#getContentType() method
- Content-Transfer-Encoding: to select the correct decoding for the
content
- Returns:
- the multipart entry just read or
null
if there is
no more entry
- Throws:
- java.io.IOException - if an I/O error has occurred