Class StreamingObjectMapperEntity
- java.lang.Object
-
- de.xima.fc.prompt.ms.impl.service.generic_oai.client.internals.StreamingObjectMapperEntity
-
- All Implemented Interfaces:
org.apache.http.HttpEntity
public final class StreamingObjectMapperEntity extends Object implements org.apache.http.HttpEntity
An HTTP entity that provides data from an object serialized to JSON using Jackson's ObjectMapper. Uses the streaming API to avoid reading the entire JSON into memory at once, especially useful for large objects such as base64 encoded data.- Since:
- 8.5.0
-
-
Constructor Summary
Constructors Constructor Description StreamingObjectMapperEntity(com.fasterxml.jackson.databind.ObjectMapper mapper, Object data)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidconsumeContent()InputStreamgetContent()org.apache.http.HeadergetContentEncoding()longgetContentLength()org.apache.http.HeadergetContentType()booleanisChunked()booleanisRepeatable()booleanisStreaming()voidwriteTo(OutputStream outStream)
-
-
-
Constructor Detail
-
StreamingObjectMapperEntity
public StreamingObjectMapperEntity(com.fasterxml.jackson.databind.ObjectMapper mapper, Object data)
-
-
Method Detail
-
consumeContent
public void consumeContent()
- Specified by:
consumeContentin interfaceorg.apache.http.HttpEntity
-
getContent
public InputStream getContent() throws UnsupportedOperationException
- Specified by:
getContentin interfaceorg.apache.http.HttpEntity- Throws:
UnsupportedOperationException
-
getContentEncoding
public org.apache.http.Header getContentEncoding()
- Specified by:
getContentEncodingin 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
-
isChunked
public boolean isChunked()
- Specified by:
isChunkedin interfaceorg.apache.http.HttpEntity
-
isRepeatable
public boolean isRepeatable()
- Specified by:
isRepeatablein interfaceorg.apache.http.HttpEntity
-
isStreaming
public boolean isStreaming()
- Specified by:
isStreamingin interfaceorg.apache.http.HttpEntity
-
writeTo
public void writeTo(OutputStream outStream) throws IOException
- Specified by:
writeToin interfaceorg.apache.http.HttpEntity- Throws:
IOException
-
-