WebBody.BytesBody, WebBody.PathBody| Constructor and Description |
|---|
BytesBody(byte[] bytes,
@Nullable java.lang.String contentType) |
| Modifier and Type | Method and Description |
|---|---|
@Nullable java.lang.String |
contentType()
The mime content type for this data.
|
long |
length()
The length of the data.
|
boolean |
multiOpenAllowed()
Checks if this WebBody supports
WebBody.open() being
called multiple times. |
java.io.InputStream |
open()
Open a stream to read the body data.
|
java.nio.channels.ReadableByteChannel |
openChannel()
Open a byte channel into a body data.
|
public BytesBody(byte[] bytes,
@Nullable
@Nullable java.lang.String contentType)
public java.io.InputStream open()
WebBodypublic java.nio.channels.ReadableByteChannel openChannel()
WebBody
If the underlying data does not support Channels,
the WebBody.open() InputStream will be wrapped
to a ReadableByteChannel.
openChannel in interface WebBodypublic boolean multiOpenAllowed()
WebBodyWebBody.open() being
called multiple times.multiOpenAllowed in interface WebBodypublic long length()
WebBody@Nullable public @Nullable java.lang.String contentType()
WebBodycontentType in interface WebBody