Interface ChunkInterceptor

  • All Implemented Interfaces:

    
    public interface ChunkInterceptor
    
                        

    An interceptor to inspect or modify individual byte chunks as they are being received from the HTTP response body.

    • The onChunk method can be called multiple times for the same response.

    • The onEnd method is called at most once after the last chunk has been received.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      abstract ByteArray onChunk(ByteArray chunk) Called when a byte chunk is received from the HTTP response body.
      ByteArray onEnd() Called after the last chunk of the HTTP response body has been received.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

    • Method Detail

      • onChunk

         abstract ByteArray onChunk(ByteArray chunk)

        Called when a byte chunk is received from the HTTP response body.

        Parameters:
        chunk - The received byte chunk.
        Returns:

        A byte chunk that will be appended to the modified response body. This can be the original chunk, or a modified chunk.

      • onEnd

         ByteArray onEnd()

        Called after the last chunk of the HTTP response body has been received.

        Returns:

        An (optional) additional byte chunk that will be appended to the modified response body.