public class LengthedBody extends MessageBody
| Modifier and Type | Class and Description |
|---|---|
static interface |
LengthedBody.LengthedReadableByteChannel |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
void |
consume() |
static LengthedBody |
create(ReadableByteChannel channel,
ByteBuffer buffer,
long size) |
boolean |
isOpen() |
long |
position()
The current position in bytes within the content body.
|
int |
read(ByteBuffer dest) |
long |
size()
The length in bytes of the content body.
|
InputStream |
stream()
Returns an InputStream for reading this body.
|
emptygetErrorContext, getErrorContextpublic static LengthedBody create(ReadableByteChannel channel, ByteBuffer buffer, long size)
public int read(ByteBuffer dest) throws IOException
IOExceptionpublic void consume()
throws IOException
consume in class MessageBodyIOExceptionpublic boolean isOpen()
public void close()
throws IOException
IOExceptionpublic long size()
size in class MessageBodypublic long position()
position in class MessageBodypublic InputStream stream()
stream in class MessageBodyCopyright © 2023. All rights reserved.