Top Description Fields Constructors Methods
org.eclipse.jetty.util

public Class MultiPartOutputStream

extends FilterOutputStream
Class Inheritance
Imports
java.io.FilterOutputStream, .IOException, .OutputStream, java.nio.charset.StandardCharsets

Handle a multipart MIME response.

Field Summary

Modifier and TypeField and Description
private final String
private final byte[]
private static final byte[]
private static final byte[]
private boolean
public static final String
public static final String
Inherited from java.io.FilterOutputStream:
out

Constructor Summary

AccessConstructor and Description
public
public

Method Summary

Modifier and TypeMethod and Description
public void
close()

Overrides java.io.FilterOutputStream.close.

Implements java.io.Closeable.close.

End the current part.

public String
public OutputStream
public void
startPart(String
the content type of the part
contentType
)

Start creation of the next Content.

public void
startPart(String
the content type of the part
contentType
,
String[]
the part headers
headers
)

Start creation of the next Content.

public void
write(byte[] b, int off, int len)

Overrides java.io.FilterOutputStream.write.

Writes len bytes from the specified byte array starting at offset off to this output stream.

Inherited from java.io.FilterOutputStream:
flushwritewrite

Field Detail

boundaryback to summary
private final String boundary
boundaryBytesback to summary
private final byte[] boundaryBytes
CRLFback to summary
private static final byte[] CRLF
DASHDASHback to summary
private static final byte[] DASHDASH
inPartback to summary
private boolean inPart
MULTIPART_MIXEDback to summary
public static final String MULTIPART_MIXED
MULTIPART_X_MIXED_REPLACEback to summary
public static final String MULTIPART_X_MIXED_REPLACE

Constructor Detail

MultiPartOutputStreamback to summary
public MultiPartOutputStream(OutputStream out) throws IOException
MultiPartOutputStreamback to summary
public MultiPartOutputStream(OutputStream out, String boundary) throws IOException

Method Detail

closeback to summary
public void close() throws IOException

Overrides java.io.FilterOutputStream.close.

Implements java.io.Closeable.close.

End the current part.

Annotations
@Override
Exceptions
IOException:
IOException
getBoundaryback to summary
public String getBoundary()
getOutback to summary
public OutputStream getOut()
startPartback to summary
public void startPart(String contentType) throws IOException

Start creation of the next Content.

Parameters
contentType:String

the content type of the part

Exceptions
IOException:
if unable to write the part
startPartback to summary
public void startPart(String contentType, String[] headers) throws IOException

Start creation of the next Content.

Parameters
contentType:String

the content type of the part

headers:String[]

the part headers

Exceptions
IOException:
if unable to write the part
writeback to summary
public void write(byte[] b, int off, int len) throws IOException

Overrides java.io.FilterOutputStream.write.

Doc from java.io.FilterOutputStream.write.

Writes len bytes from the specified byte array starting at offset off to this output stream.

Annotations
@Override
Exceptions
IOException:
if an I/O error occurs.