Class FileSmoosher

  • All Implemented Interfaces:
    Closeable, AutoCloseable

    public class FileSmoosher
    extends Object
    implements Closeable
    A class that concatenates files together into configurable sized chunks, works in conjunction with the SmooshedFileMapper to provide access to the individual files.

    It does not split input files among separate output files, instead the various "chunk" files will be varying sizes and it is not possible to add a file of size greater than Integer.MAX_VALUE.

    This class is not thread safe.

    This class allows writing multiple files even if main smoosh file writer is open. If main smoosh file writer is already open, it delegates the write into temporary file on the file system which is later copied on to the main smoosh file and underlying temporary file will be cleaned up.