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()
close
in interface Closeable
close
in interface AutoCloseable
public long getContentLength()
Body
getContentLength
in interface Body
public String getContentType()
public byte[] getBoundary()
public Body.BodyState transferTo(io.netty.buffer.ByteBuf target) throws IOException
Body
transferTo
in interface Body
target
- The buffer to store the chunk in, must not be null
.IOException
- If the chunk could not be read.public long transferTo(WritableByteChannel target) throws IOException
RandomAccessBody
transferTo
in interface RandomAccessBody
target
- The destination channel to transfer the body chunk to, must not be null
.IOException
- If the body chunk could not be transferred.Copyright © 2019. All rights reserved.