com.ning.http.multipart
public class MultipartBody extends java.lang.Object implements RandomAccessBody
Constructor and Description |
---|
MultipartBody(java.util.List<Part> parts,
java.lang.String boundary,
java.lang.String contentLength) |
Modifier and Type | Method and Description |
---|---|
void |
close()
Releases any resources associated with this body.
|
long |
getContentLength()
Gets the length of the body.
|
long |
read(java.nio.ByteBuffer buffer)
Reads the next chunk of bytes from the body.
|
long |
transferTo(long position,
long count,
java.nio.channels.WritableByteChannel target)
Transfers the specified chunk of bytes from this body to the specified channel.
|
public MultipartBody(java.util.List<Part> parts, java.lang.String boundary, java.lang.String contentLength)
public void close() throws java.io.IOException
Body
public long getContentLength()
Body
getContentLength
in interface Body
public long read(java.nio.ByteBuffer buffer) throws java.io.IOException
Body
public long transferTo(long position, long count, java.nio.channels.WritableByteChannel target) throws java.io.IOException
RandomAccessBody
transferTo
in interface RandomAccessBody
position
- The zero-based byte index from which to start the transfer, must not be negative.count
- The maximum number of bytes to transfer, must not be negative.target
- The destination channel to transfer the body chunk to, must not be null
.java.io.IOException
- If the body chunk could not be transferred.Copyright © 2014. All Rights Reserved.