Class Content
- java.lang.Object
-
- org.apache.hc.client5.http.fluent.Content
-
public class Content extends java.lang.ObjectThis class represents arbitrary content of a specific type that can be consumed multiple times and requires no explicit deallocation used by the fluent facade.- Since:
- 4.2
-
-
Field Summary
Fields Modifier and Type Field Description static ContentNO_CONTENTprivate byte[]rawprivate org.apache.hc.core5.http.ContentTypetype
-
Constructor Summary
Constructors Constructor Description Content(byte[] raw, org.apache.hc.core5.http.ContentType type)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description byte[]asBytes()java.io.InputStreamasStream()java.lang.StringasString()java.lang.StringasString(java.nio.charset.Charset charset)org.apache.hc.core5.http.ContentTypegetType()java.lang.StringtoString()
-
-
-
Field Detail
-
NO_CONTENT
public static final Content NO_CONTENT
-
raw
private final byte[] raw
-
type
private final org.apache.hc.core5.http.ContentType type
-
-
Method Detail
-
getType
public org.apache.hc.core5.http.ContentType getType()
-
asBytes
public byte[] asBytes()
-
asString
public java.lang.String asString()
-
asString
public java.lang.String asString(java.nio.charset.Charset charset)
- Since:
- 4.4
-
asStream
public java.io.InputStream asStream()
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-