Interface IterativeStreamChunkerCore

All Known Implementing Classes:
FastCdcChunkerCore, FixedSizeChunkerCore, NlfiedlerRustChunkerCore
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface
public interface IterativeStreamChunkerCore
Interface for the core algorithm used by a chunker that iteratively processes the stream.
Author:
Daniel Tischner <zabuza.dev@gmail.com>
  • Method Summary

    Modifier and Type Method Description
    byte[] readNextChunk​(java.io.InputStream stream, long size, long currentOffset)
    Reads the next chunk from the given data stream.
  • Method Details

    • readNextChunk

      byte[] readNextChunk​(java.io.InputStream stream, long size, long currentOffset)
      Reads the next chunk from the given data stream. The stream is consumed by exactly the length of the provided chunk. The stream is safe to be read byte by byte, it provides buffering methods if necessary.
      Parameters:
      stream - The data stream to chunk, not null
      size - Remaining data available in the stream that are subject to be chunked, must be positive and not zero
      currentOffset - Current offset in the given stream, in regards to its original start, must be positive and less than size
      Returns:
      The chunk that was read