Class MaskGenerator

java.lang.Object
de.zabuza.fastcdc4j.internal.chunking.MaskGenerator

public final class MaskGenerator
extends java.lang.Object
Utility class for generating masks that are used by Chunkers.
Author:
Daniel Tischner <zabuza.dev@gmail.com>
  • Constructor Summary

    Constructors 
    Constructor Description
    MaskGenerator​(MaskOption maskOption, int normalizationLevel, int expectedChunkSize, long seed)
    Creates a new mask generator.
  • Method Summary

    Modifier and Type Method Description
    long generateLargeMask()
    Generates a mask to be used for content larger than the expected chunk size, making chunking easier.
    long generateSmallMask()
    Generates a mask to be used for content smaller than the expected chunk size, making chunking harder.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • MaskGenerator

      public MaskGenerator​(MaskOption maskOption, int normalizationLevel, int expectedChunkSize, long seed)
      Creates a new mask generator.
      Parameters:
      maskOption - The option describing which technique to use for mask generation, not null
      normalizationLevel - The normalization level to use, positive
      expectedChunkSize - The expected chunk size in bytes, positive and not zero
      seed - The seed to use for distributing bits in the mask generation
  • Method Details

    • generateLargeMask

      public long generateLargeMask()
      Generates a mask to be used for content larger than the expected chunk size, making chunking easier.
      Returns:
      The generated mask
    • generateSmallMask

      public long generateSmallMask()
      Generates a mask to be used for content smaller than the expected chunk size, making chunking harder.
      Returns:
      The generated mask