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.
  • Constructor Details

    • RawApiEntityConsumer

      public RawApiEntityConsumer(boolean isResponse, int maxCapacity)
  • Method Details

    • generateContent

      public ApiEntity<T> generateContent()
      Description copied from interface: TypedApiEntityConsumer
      Generates the final content after all data has been consumed.
      Specified by:
      generateContent in interface TypedApiEntityConsumer<T>
      Returns:
      an ApiEntity containing the deserialized content, or null if no data was consumed
    • consumeData

      public void consumeData(ByteBuffer src, boolean endOfStream)
      Description copied from interface: TypedApiEntityConsumer
      Consumes data from the provided ByteBuffer. This method is called as data becomes available and can be invoked multiple times as more data is streamed.
      Specified by:
      consumeData in interface TypedApiEntityConsumer<T>
      Parameters:
      src - the ByteBuffer containing the data to be consumed
      endOfStream - a flag indicating whether this is the last chunk of data
    • releaseResources

      public void releaseResources()
      Description copied from interface: TypedApiEntityConsumer
      Releases 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:
      releaseResources in interface TypedApiEntityConsumer<T>
    • getBufferedBytes

      public int getBufferedBytes()
      Description copied from interface: TypedApiEntityConsumer
      Returns the number of bytes currently buffered by this consumer.
      Specified by:
      getBufferedBytes in interface TypedApiEntityConsumer<T>
      Returns:
      the number of buffered bytes