com.caucho.vfs
Class MultipartStream
java.lang.Object
|
+--com.caucho.vfs.StreamImpl
|
+--com.caucho.vfs.MultipartStream
- public class MultipartStream
- extends StreamImpl
Method Summary |
boolean |
canRead()
|
java.lang.Object |
getAttribute(java.lang.String key)
Returns a read attribute from the multipart mime. |
java.util.Iterator |
getAttributeNames()
Returns the headers from the mime. |
void |
init(ReadStream is,
java.lang.String headerBoundary)
Initialize the multipart stream with a given boundary. |
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. |
Methods inherited from class com.caucho.vfs.StreamImpl |
canWrite, clearWrite, close, flush, getAvailable, getFlushOnNewline, getNewline, getPath, getReadPosition, removeAttribute, setAttribute, setPath, write, write |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
MultipartStream
public MultipartStream()
throws java.io.IOException
MultipartStream
public MultipartStream(ReadStream is,
java.lang.String boundary)
throws java.io.IOException
init
public void init(ReadStream is,
java.lang.String headerBoundary)
throws java.io.IOException
- Initialize the multipart stream with a given boundary. The boundary
passed to
init
will have "--" prefixed.
- Parameters:
is
- the underlying streamheaderBoundary
- the multipart/mime boundary.
openRead
public ReadStream openRead()
throws java.io.IOException
- Opens the next part of the multipart/mime stream for reading. Returns
null when the last section is read.
getAttribute
public java.lang.Object getAttribute(java.lang.String key)
- Returns a read attribute from the multipart mime.
- Overrides:
getAttribute
in class StreamImpl
getAttributeNames
public java.util.Iterator getAttributeNames()
- Returns the headers from the mime.
- Overrides:
getAttributeNames
in class StreamImpl
canRead
public boolean canRead()
- Overrides:
canRead
in class StreamImpl
read
public int read(byte[] buffer,
int offset,
int length)
throws java.io.IOException
- Reads from the multipart mime buffer.
- Overrides:
read
in class StreamImpl