Class TransferCompleteness

java.lang.Object
slash.navigation.download.performer.TransferCompleteness

public final class TransferCompleteness extends Object
Pure functions to reason about the completeness of an HTTP transfer: the inclusive range end for a resume request, the total bytes a temp file must have afterward, and whether a transfer that fell short of that total may still serve a later resume.
Author:
Christian Pesch
  • Method Details

    • resumeRangeEnd

      public static Long resumeRangeEnd(Long contentLength)
    • expectedBytesOnDisk

      public static Long expectedBytesOnDisk(long resumeOffset, Long responseContentLength)
    • isComplete

      public static boolean isComplete(long bytesOnDisk, Long expectedBytesOnDisk)
    • keepForResume

      public static boolean keepForResume(long bytesOnDisk, Long expectedBytesOnDisk)