Class Content


  • public class Content
    extends java.lang.Object
    This class represents arbitrary content of a specific type that can be consumed multiple times and requires no explicit deallocation.
    • Constructor Summary

      Constructors 
      Constructor Description
      Content​(byte[] raw, org.apache.http.entity.ContentType type)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      byte[] asBytes()  
      java.io.InputStream asStream()  
      java.lang.String asString()  
      java.lang.String asString​(java.nio.charset.Charset charset)  
      org.apache.http.entity.ContentType getType()  
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • NO_CONTENT

        public static final Content NO_CONTENT
    • Constructor Detail

      • Content

        public Content​(byte[] raw,
                       org.apache.http.entity.ContentType type)
    • Method Detail

      • getType

        public org.apache.http.entity.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:
        toString in class java.lang.Object