java.lang.Object
org.eclipse.jetty.io.content.InputStreamContentSource
org.eclipse.jetty.client.InputStreamRequestContent
- All Implemented Interfaces:
Request.Content,org.eclipse.jetty.io.Content.Source
public class InputStreamRequestContent
extends org.eclipse.jetty.io.content.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.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.eclipse.jetty.io.Content.Source
org.eclipse.jetty.io.Content.Source.Factory -
Constructor Summary
ConstructorsConstructorDescriptionInputStreamRequestContent(InputStream stream) Deprecated.InputStreamRequestContent(InputStream stream, int bufferSize) Deprecated.InputStreamRequestContent(String contentType, InputStream stream) Deprecated.InputStreamRequestContent(String contentType, InputStream stream, int bufferSize) Deprecated.InputStreamRequestContent(String contentType, InputStream stream, org.eclipse.jetty.io.ByteBufferPool bufferPool) Deprecated.InputStreamRequestContent(String contentType, InputStream stream, org.eclipse.jetty.io.ByteBufferPool.Sized bufferPool) -
Method Summary
Methods inherited from class org.eclipse.jetty.io.content.InputStreamContentSource
demand, fail, fillBufferFromInputStream, readMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.eclipse.jetty.io.Content.Source
demand, fail, fail, getLength, read, rewind
-
Constructor Details
-
InputStreamRequestContent
Deprecated. -
InputStreamRequestContent
Deprecated. -
InputStreamRequestContent
@Deprecated public InputStreamRequestContent(String contentType, InputStream stream, int bufferSize) Deprecated. -
InputStreamRequestContent
Deprecated. -
InputStreamRequestContent
@Deprecated public InputStreamRequestContent(String contentType, InputStream stream, org.eclipse.jetty.io.ByteBufferPool bufferPool) Deprecated. -
InputStreamRequestContent
public InputStreamRequestContent(String contentType, InputStream stream, org.eclipse.jetty.io.ByteBufferPool.Sized bufferPool)
-
-
Method Details
-
getContentType
- Specified by:
getContentTypein interfaceRequest.Content- Returns:
- the value of the
Content-Typeheader for the request content, such astext/html;charset=utf-8orapplication/json, ornullto use the value fromHttpClient.getDefaultRequestContentType()
-
InputStreamRequestContent(String, InputStream, ByteBufferPool.Sized)instead.