static class BasicBodyFactory.BinaryBody2 extends BinaryBody
| Modifier and Type | Field and Description |
|---|---|
private java.nio.charset.Charset |
charset |
private java.lang.String |
content |
| Constructor and Description |
|---|
BinaryBody2(java.lang.String content,
java.nio.charset.Charset charset) |
| Modifier and Type | Method and Description |
|---|---|
SingleBody |
copy()
Returns a copy of this
SingleBody (optional operation). |
void |
dispose()
Subclasses should override this method if they have allocated resources
that need to be freed explicitly (e.g.
|
java.io.InputStream |
getInputStream()
Gets a
InputStream which reads the bytes of the body. |
getParent, setParent, writeToprivate final java.lang.String content
private final java.nio.charset.Charset charset
BinaryBody2(java.lang.String content,
java.nio.charset.Charset charset)
public java.io.InputStream getInputStream()
throws java.io.IOException
SingleBodyInputStream which reads the bytes of the body.getInputStream in class SingleBodyjava.io.IOException - on I/O errors.public void dispose()
SingleBodydispose in interface Disposabledispose in class SingleBodyDisposable.dispose()public SingleBody copy()
SingleBodySingleBody (optional operation).
The general contract of this method is as follows:
SingleBody.getParent() on the copy returns null.
That means that the copy is detached from the parent entity of this
SingleBody. The copy may get attached to a different
entity later on.SingleBody.
This implementation always throws an
UnsupportedOperationException.
copy in class SingleBodySingleBody.