Class HeapResource

  • All Implemented Interfaces:
    java.io.Serializable, Resource

    @Contract(threading=IMMUTABLE)
    public class HeapResource
    extends java.lang.Object
    implements Resource
    Cache resource backed by a byte array on the heap.
    Since:
    4.1
    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private byte[] b  
      private static long serialVersionUID  
    • Constructor Summary

      Constructors 
      Constructor Description
      HeapResource​(byte[] b)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void dispose()
      Indicates the system no longer needs to keep this response body and any system resources associated with it may be reclaimed.
      (package private) byte[] getByteArray()  
      java.io.InputStream getInputStream()
      Returns an InputStream from which the response body can be read.
      long length()
      Returns the length in bytes of the response body.
      • Methods inherited from class java.lang.Object

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

      • b

        private final byte[] b
    • Constructor Detail

      • HeapResource

        public HeapResource​(byte[] b)
    • Method Detail

      • getByteArray

        byte[] getByteArray()
      • getInputStream

        public java.io.InputStream getInputStream()
        Description copied from interface: Resource
        Returns an InputStream from which the response body can be read.
        Specified by:
        getInputStream in interface Resource
      • length

        public long length()
        Description copied from interface: Resource
        Returns the length in bytes of the response body.
        Specified by:
        length in interface Resource
      • dispose

        public void dispose()
        Description copied from interface: Resource
        Indicates the system no longer needs to keep this response body and any system resources associated with it may be reclaimed.
        Specified by:
        dispose in interface Resource