Class ChunkPagingProvider

java.lang.Object
com.mulesoftforge.mule.extension.chunking.internal.paging.ChunkPagingProvider
All Implemented Interfaces:
org.mule.runtime.extension.api.runtime.streaming.PagingProvider<ChunkingConnection, Chunk>, org.mule.sdk.api.runtime.streaming.PagingProvider<ChunkingConnection, Chunk>

public class ChunkPagingProvider extends Object implements org.mule.runtime.extension.api.runtime.streaming.PagingProvider<ChunkingConnection, Chunk>
PagingProvider that lazily produces Chunk objects from an InputStream. Memory usage: O(chunkSize) + O(1) for probe byte - Single buffer for reading chunks - 1-byte pushback buffer for EOF detection - NO read-ahead buffer that would double memory isLast detection strategy: 1. Read chunk into buffer 2. If partial read (invalid input: '<' chunkSize), this is last chunk 3. If full read, probe with 1-byte read: - If returns -1: this is last chunk - If returns byte: push back, more data exists
  • Constructor Details

    • ChunkPagingProvider

      public ChunkPagingProvider(InputStream source, int chunkSize)
  • Method Details