Package io.camunda.client.impl.http
Class TypedApiEntityConsumer.RawApiEntityConsumer<T>
java.lang.Object
io.camunda.client.impl.http.TypedApiEntityConsumer.RawApiEntityConsumer<T>
- All Implemented Interfaces:
TypedApiEntityConsumer<T>
- Enclosing interface:
TypedApiEntityConsumer<T>
public static class TypedApiEntityConsumer.RawApiEntityConsumer<T>
extends Object
implements TypedApiEntityConsumer<T>
A
TypedApiEntityConsumer implementation for handling raw data, which could be text or
binary. This consumer accumulates the raw data into a byte array, which can later be converted
to a string or another appropriate type.-
Nested Class Summary
Nested classes/interfaces inherited from interface io.camunda.client.impl.http.TypedApiEntityConsumer
TypedApiEntityConsumer.JsonApiEntityConsumer<T>, TypedApiEntityConsumer.RawApiEntityConsumer<T> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidconsumeData(ByteBuffer src, boolean endOfStream) Consumes data from the providedByteBuffer.Generates the final content after all data has been consumed.intReturns the number of bytes currently buffered by this consumer.voidReleases any resources associated with this consumer.
-
Constructor Details
-
RawApiEntityConsumer
public RawApiEntityConsumer(boolean isResponse, int maxCapacity)
-
-
Method Details
-
generateContent
Description copied from interface:TypedApiEntityConsumerGenerates the final content after all data has been consumed.- Specified by:
generateContentin interfaceTypedApiEntityConsumer<T>- Returns:
- an
ApiEntitycontaining the deserialized content, or null if no data was consumed
-
consumeData
Description copied from interface:TypedApiEntityConsumerConsumes data from the providedByteBuffer. This method is called as data becomes available and can be invoked multiple times as more data is streamed.- Specified by:
consumeDatain interfaceTypedApiEntityConsumer<T>- Parameters:
src- theByteBuffercontaining the data to be consumedendOfStream- a flag indicating whether this is the last chunk of data
-
releaseResources
public void releaseResources()Description copied from interface:TypedApiEntityConsumerReleases any resources associated with this consumer. This method should be called once the consumer is no longer needed, such as after the response has been fully processed.- Specified by:
releaseResourcesin interfaceTypedApiEntityConsumer<T>
-
getBufferedBytes
public int getBufferedBytes()Description copied from interface:TypedApiEntityConsumerReturns the number of bytes currently buffered by this consumer.- Specified by:
getBufferedBytesin interfaceTypedApiEntityConsumer<T>- Returns:
- the number of buffered bytes
-