public class MultipartBody extends Object implements RandomAccessBody
Body.BodyState| Constructor and Description |
|---|
MultipartBody(List<MultipartPart<? extends Part>> parts,
String contentType,
byte[] boundary) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
byte[] |
getBoundary() |
long |
getContentLength()
Gets the length of the body.
|
String |
getContentType() |
Body.BodyState |
transferTo(io.netty.buffer.ByteBuf target)
Reads the next chunk of bytes from the body.
|
long |
transferTo(WritableByteChannel target)
Transfers the specified chunk of bytes from this body to the specified channel.
|
public MultipartBody(List<MultipartPart<? extends Part>> parts, String contentType, byte[] boundary)
public void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableIOExceptionpublic long getContentLength()
BodygetContentLength in interface Bodypublic String getContentType()
public byte[] getBoundary()
public Body.BodyState transferTo(io.netty.buffer.ByteBuf target) throws IOException
BodytransferTo in interface Bodytarget - The buffer to store the chunk in, must not be null.-1 if the body has been read completely.IOException - If the chunk could not be read.public long transferTo(WritableByteChannel target) throws IOException
RandomAccessBodytransferTo in interface RandomAccessBodytarget - The destination channel to transfer the body chunk to, must not be null.IOException - If the body chunk could not be transferred.Copyright © 2016. All Rights Reserved.