Class InputStreamRequestContent

java.lang.Object
org.eclipse.jetty.io.content.InputStreamContentSource
org.eclipse.jetty.client.InputStreamRequestContent
All Implemented Interfaces:
Request.Content, Content.Source
Direct Known Subclasses:
ProxyServlet.ProxyInputStreamRequestContent

public class InputStreamRequestContent extends InputStreamContentSource implements Request.Content

A Request.Content that produces content from an InputStream.

The input stream is read once and therefore fully consumed.

It is possible to specify, at the constructor, a buffer size used to read content from the stream, by default 4096 bytes.

The InputStream passed to the constructor is by default closed when is it fully consumed.

  • Constructor Details

    • InputStreamRequestContent

      public InputStreamRequestContent(InputStream stream)
    • InputStreamRequestContent

      public InputStreamRequestContent(InputStream stream, int bufferSize)
    • InputStreamRequestContent

      public InputStreamRequestContent(String contentType, InputStream stream, int bufferSize)
    • InputStreamRequestContent

      public InputStreamRequestContent(String contentType, InputStream stream)
    • InputStreamRequestContent

      public InputStreamRequestContent(String contentType, InputStream stream, ByteBufferPool bufferPool)
  • Method Details

    • getContentType

      public String getContentType()
      Specified by:
      getContentType in interface Request.Content
      Returns:
      the content type string such as "application/octet-stream" or "application/json;charset=UTF8", or null if the Content-Type header must not be set