Interface StreamCachingStrategy.SpoolRule

Enclosing interface:
StreamCachingStrategy

public static interface StreamCachingStrategy.SpoolRule
Rule for determine if stream caching should be spooled to disk or kept in-memory.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    shouldSpoolCache(long length)
    Determines if the stream should be spooled or not.
  • Method Details

    • shouldSpoolCache

      boolean shouldSpoolCache(long length)
      Determines if the stream should be spooled or not. For example if the stream length is over a threshold.

      This allows implementations to use custom strategies to determine if spooling is needed or not.

      Parameters:
      length - the length of the stream
      Returns:
      true to spool the cache, or false to keep the cache in-memory