public class MultiPartOutputStream
extends java.io.FilterOutputStream
| Modifier and Type | Field and Description |
|---|---|
private static byte[] |
__CRLF |
private static byte[] |
__DASHDASH |
private java.lang.String |
boundary |
private byte[] |
boundaryBytes |
private boolean |
inPart |
static java.lang.String |
MULTIPART_MIXED |
static java.lang.String |
MULTIPART_X_MIXED_REPLACE |
| Constructor and Description |
|---|
MultiPartOutputStream(java.io.OutputStream out) |
MultiPartOutputStream(java.io.OutputStream out,
java.lang.String boundary) |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
End the current part.
|
java.lang.String |
getBoundary() |
java.io.OutputStream |
getOut() |
void |
startPart(java.lang.String contentType)
Start creation of the next Content.
|
void |
startPart(java.lang.String contentType,
java.lang.String[] headers)
Start creation of the next Content.
|
void |
write(byte[] b,
int off,
int len) |
private static final byte[] __CRLF
private static final byte[] __DASHDASH
public static final java.lang.String MULTIPART_MIXED
public static final java.lang.String MULTIPART_X_MIXED_REPLACE
private final java.lang.String boundary
private final byte[] boundaryBytes
private boolean inPart
public MultiPartOutputStream(java.io.OutputStream out)
throws java.io.IOException
java.io.IOExceptionpublic MultiPartOutputStream(java.io.OutputStream out,
java.lang.String boundary)
throws java.io.IOException
java.io.IOExceptionpublic void close()
throws java.io.IOException
close in interface java.io.Closeableclose in interface java.lang.AutoCloseableclose in class java.io.FilterOutputStreamjava.io.IOException - IOExceptionpublic java.lang.String getBoundary()
public java.io.OutputStream getOut()
public void startPart(java.lang.String contentType)
throws java.io.IOException
contentType - the content type of the partjava.io.IOException - if unable to write the partpublic void startPart(java.lang.String contentType,
java.lang.String[] headers)
throws java.io.IOException
contentType - the content type of the partheaders - the part headersjava.io.IOException - if unable to write the partpublic void write(byte[] b,
int off,
int len)
throws java.io.IOException
write in class java.io.FilterOutputStreamjava.io.IOException