public class MultipartStream extends StreamImpl
_nullPath, _path| Constructor and Description |
|---|
MultipartStream() |
MultipartStream(ReadStream is,
java.lang.String boundary) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
canRead()
Returns true if this is a read stream.
|
java.lang.String |
getAttribute(java.lang.String key)
Returns a read attribute from the multipart mime.
|
java.util.Iterator |
getAttributeNames()
Returns the headers from the mime.
|
int |
getAvailable()
Returns the number of available bytes.
|
java.lang.String |
getEncoding()
Returns the default encoding.
|
java.util.HashMap<java.lang.String,java.util.List<java.lang.String>> |
getHeaders() |
void |
init(ReadStream is,
java.lang.String headerBoundary)
Initialize the multipart stream with a given boundary.
|
boolean |
isComplete()
Returns true if complete.
|
ReadStream |
openRead()
Opens the next part of the multipart/mime stream for reading.
|
int |
read(byte[] buffer,
int offset,
int length)
Reads from the multipart mime buffer.
|
void |
setEncoding(java.lang.String encoding)
Sets the default encoding.
|
canWrite, clearWrite, close, closeWrite, flush, flushBuffer, flushToDisk, getFlushOnNewline, getNewline, getPath, getReadBuffer, getReadPosition, hasSkip, isClosed, isEof, isMmapEnabled, isSendfileEnabled, readNonBlock, readTimeout, removeAttribute, seekEnd, seekStart, setAttribute, setPath, setWriteEncoding, skip, write, write, writeMmap, writeSendfilepublic MultipartStream()
throws java.io.IOException
java.io.IOExceptionpublic MultipartStream(ReadStream is, java.lang.String boundary) throws java.io.IOException
java.io.IOExceptionpublic java.lang.String getEncoding()
public void setEncoding(java.lang.String encoding)
public void init(ReadStream is, java.lang.String headerBoundary) throws java.io.IOException
init will have "--" prefixed.is - the underlying streamheaderBoundary - the multipart/mime boundary.java.io.IOExceptionpublic boolean isComplete()
public ReadStream openRead() throws java.io.IOException
java.io.IOExceptionpublic java.lang.String getAttribute(java.lang.String key)
getAttribute in class StreamImplkey - the attribute name.public java.util.Iterator getAttributeNames()
getAttributeNames in class StreamImplpublic java.util.HashMap<java.lang.String,java.util.List<java.lang.String>> getHeaders()
public boolean canRead()
StreamImplcanRead in class StreamImplpublic int getAvailable()
throws java.io.IOException
getAvailable in class StreamImpljava.io.IOExceptionpublic int read(byte[] buffer,
int offset,
int length)
throws java.io.IOException
read in class StreamImplbuffer - byte array receiving the data.offset - starting offset into the array.length - number of bytes to read.java.io.IOException