public class MultipartMessage extends Object implements Writable
Multipart). The class maintains order of multipart bodies as they
appear in multipart byte stream.| Modifier and Type | Field and Description |
|---|---|
protected static byte |
CR |
protected static byte |
DASH |
protected static byte |
LF |
protected static ByteBuffer |
LINE_FEED_BUFFER |
protected static byte[] |
LINE_FEED_BYTES |
| Constructor and Description |
|---|
MultipartMessage() |
MultipartMessage(byte[] boundary) |
MultipartMessage(String boundary) |
| Modifier and Type | Method and Description |
|---|---|
void |
addHeader(String key,
String value) |
void |
addHeaders(Map<String,String> headers) |
void |
addMultiPart(Multipart part) |
static String |
generateBoundary() |
byte[] |
getBoundary() |
int |
getBoundayLength() |
String |
getHeader(String key) |
Map<String,String> |
getHeaders() |
List<Multipart> |
getParts() |
Multipart |
newMultipart()
Returns a new multipart.
|
int |
partCount() |
void |
setHeaders(Map<String,String> headers) |
long |
writeTo(OutputStream os)
Write to an
OutputStream |
long |
writeTo(Socket socket)
Write this entity to a network socket.
|
long |
writeTo(SocketChannel socketChannel)
Write this entity to a
SocketChannel |
protected static final byte DASH
protected static final byte LF
protected static final byte CR
protected static final byte[] LINE_FEED_BYTES
protected static final ByteBuffer LINE_FEED_BUFFER
public MultipartMessage()
public MultipartMessage(byte[] boundary)
public MultipartMessage(String boundary)
public static String generateBoundary()
public void addMultiPart(Multipart part)
public byte[] getBoundary()
public int getBoundayLength()
public Multipart newMultipart()
public int partCount()
public long writeTo(OutputStream os) throws IOException
WritableOutputStreamwriteTo in interface Writableos - OutputStream insatnceIOException - if IO error occurrspublic long writeTo(Socket socket) throws IOException
WritablewriteTo in interface Writablesocket - network socket on which bytes will be writtenIOException - if any IO error occurredpublic long writeTo(SocketChannel socketChannel) throws IOException
WritableSocketChannelwriteTo in interface WritablesocketChannel - network socket channelIOException - if any IO error occurred while writing bytesCopyright © 2019. All rights reserved.