Class ApacheInputStreamEntity
- java.lang.Object
-
- java.io.InputStream
-
- java.io.FilterInputStream
-
- com.oracle.bmc.http.client.jersey3.internal.ApacheInputStreamEntity
-
- All Implemented Interfaces:
Closeable,AutoCloseable,org.apache.http.HttpEntity
- Direct Known Subclasses:
ApacheDuplicatableInputStreamEntity
public class ApacheInputStreamEntity extends FilterInputStream implements org.apache.http.HttpEntity
Class for ApacheInputStream.Apache connector in Jersey v2.32 supports passing an HttpEntity as the body. In this case Apache connector will not read entire data into memory. Content length is a must to use this conversion.
-
-
Field Summary
-
Fields inherited from class java.io.FilterInputStream
in
-
-
Constructor Summary
Constructors Constructor Description ApacheInputStreamEntity(InputStream in, Long contentLength)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidconsumeContent()Deprecated.(4.1) UseEntityUtils.consume(HttpEntity)InputStreamgetContent()org.apache.http.HeadergetContentEncoding()longgetContentLength()org.apache.http.HeadergetContentType()booleanisChunked()booleanisRepeatable()booleanisStreaming()voidwriteTo(OutputStream outputStream)-
Methods inherited from class java.io.FilterInputStream
available, close, mark, markSupported, read, read, read, reset, skip
-
Methods inherited from class java.io.InputStream
nullInputStream, readAllBytes, readNBytes, readNBytes, transferTo
-
-
-
-
Constructor Detail
-
ApacheInputStreamEntity
public ApacheInputStreamEntity(InputStream in, Long contentLength)
-
-
Method Detail
-
isRepeatable
public boolean isRepeatable()
- Specified by:
isRepeatablein interfaceorg.apache.http.HttpEntity
-
isChunked
public boolean isChunked()
- Specified by:
isChunkedin interfaceorg.apache.http.HttpEntity
-
getContentLength
public long getContentLength()
- Specified by:
getContentLengthin interfaceorg.apache.http.HttpEntity
-
getContentType
public org.apache.http.Header getContentType()
- Specified by:
getContentTypein interfaceorg.apache.http.HttpEntity
-
getContentEncoding
public org.apache.http.Header getContentEncoding()
- Specified by:
getContentEncodingin interfaceorg.apache.http.HttpEntity
-
getContent
public InputStream getContent() throws IOException, UnsupportedOperationException
- Specified by:
getContentin interfaceorg.apache.http.HttpEntity- Throws:
IOExceptionUnsupportedOperationException
-
writeTo
public void writeTo(OutputStream outputStream) throws IOException
- Specified by:
writeToin interfaceorg.apache.http.HttpEntity- Throws:
IOException
-
isStreaming
public boolean isStreaming()
- Specified by:
isStreamingin interfaceorg.apache.http.HttpEntity
-
consumeContent
@Deprecated public void consumeContent() throws IOException
Deprecated.(4.1) UseEntityUtils.consume(HttpEntity)FromHttpEntity:This method is deprecated since version 4.1. Please use standard java convention to ensure resource deallocation by calling
InputStream.close()on the input stream returned bygetContent()This method is called to indicate that the content of this entity is no longer required. All entity implementations are expected to release all allocated resources as a result of this method invocation. Content streaming entities are also expected to dispose of the remaining content, if any. Wrapping entities should delegate this call to the wrapped entity.
This method is of particular importance for entities being received from a
connection. The entity needs to be consumed completely in order to re-use the connection with keep-alive.- Specified by:
consumeContentin interfaceorg.apache.http.HttpEntity- Throws:
IOException- if an I/O error occurs.- See Also:
and #writeTo(OutputStream)
-
-