Package org.zkoss.zats.common.util
Class MultiPartOutputStream
- java.lang.Object
-
- java.io.OutputStream
-
- java.io.FilterOutputStream
-
- org.zkoss.zats.common.util.MultiPartOutputStream
-
- All Implemented Interfaces:
Closeable,Flushable,AutoCloseable
public class MultiPartOutputStream extends FilterOutputStream
Handle a multipart MIME response.
-
-
Field Summary
Fields Modifier and Type Field Description static StringMULTIPART_MIXEDstatic StringMULTIPART_X_MIXED_REPLACE-
Fields inherited from class java.io.FilterOutputStream
out
-
-
Constructor Summary
Constructors Constructor Description MultiPartOutputStream(OutputStream out, String boundary)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()End the current part.StringgetBoundary()OutputStreamgetOut()voidstartPart(String contentType)Start creation of the next Content.voidstartPart(String contentType, String[] headers)Start creation of the next Content.-
Methods inherited from class java.io.FilterOutputStream
flush, write, write, write
-
Methods inherited from class java.io.OutputStream
nullOutputStream
-
-
-
-
Constructor Detail
-
MultiPartOutputStream
public MultiPartOutputStream(OutputStream out, String boundary) throws IOException
- Throws:
IOException
-
-
Method Detail
-
close
public void close() throws IOExceptionEnd the current part.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classFilterOutputStream- Throws:
IOException- IOException
-
getBoundary
public String getBoundary()
-
getOut
public OutputStream getOut()
-
startPart
public void startPart(String contentType) throws IOException
Start creation of the next Content.- Throws:
IOException
-
startPart
public void startPart(String contentType, String[] headers) throws IOException
Start creation of the next Content.- Throws:
IOException
-
-