Package io.ocfl.api

Interface OcflFileRetriever


public interface OcflFileRetriever
This class is used to lazy-load object files. A new instance should be created for each file that's intended to be load.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns a new input stream of the file's content.
    retrieveRange(Long startPosition, Long endPosition)
    Returns an input stream of the file's content between the specified byte range.
  • Method Details

    • retrieveFile

      FixityCheckInputStream retrieveFile()
      Returns a new input stream of the file's content. The caller is responsible for closing the stream. The input stream is buffered.

      The caller may call FixityCheckInputStream.checkFixity() on the InputStream after streaming all of that data to ensure the fixity of data.

      Returns:
      FixityCheckInputStream of the file's content
    • retrieveRange

      InputStream retrieveRange(Long startPosition, Long endPosition)
      Returns an input stream of the file's content between the specified byte range. startPosition and endPosition may be null, depending on the underlying implementation, and the meaning of a null value is also implementation dependent.

      The caller is responsible for closing the stream. The input stream is buffered.

      Parameters:
      startPosition - the byte offset in the file to start reading, inclusive
      endPosition - the byte offset in the file to stop reading, inclusive
      Returns:
      a buffered input stream containing the specified file data