Class TemporaryBufferEntity

  • All Implemented Interfaces:
    AutoCloseable, org.apache.http.HttpEntity

    public class TemporaryBufferEntity
    extends org.apache.http.entity.AbstractHttpEntity
    implements AutoCloseable
    A HttpEntity which takes its content from a TemporaryBuffer
    Since:
    3.3
    • Constructor Detail

      • TemporaryBufferEntity

        public TemporaryBufferEntity​(TemporaryBuffer buffer)
        Construct a new HttpEntity which will contain the content stored in the specified buffer
        Parameters:
        buffer -
    • Method Detail

      • getBuffer

        public TemporaryBuffer getBuffer()
        Get the buffer containing the content
        Returns:
        buffer containing the content
      • isRepeatable

        public boolean isRepeatable()
        Specified by:
        isRepeatable in interface org.apache.http.HttpEntity
      • getContentLength

        public long getContentLength()
        Specified by:
        getContentLength in interface org.apache.http.HttpEntity
      • isStreaming

        public boolean isStreaming()
        Specified by:
        isStreaming in interface org.apache.http.HttpEntity
      • setContentLength

        public void setContentLength​(int contentLength)
        Set the contentLength
        Parameters:
        contentLength -
      • close

        public void close()
        Close destroys the associated buffer used to buffer the entity
        Specified by:
        close in interface AutoCloseable
        Since:
        4.5