/** * Creates a {@code CompressedSource} from an underlying {@code FileBasedSource}. The type of * compression used will be based on the file name extension unless explicitly configured via * {@link CompressedSource#withDecompression}. */ public static <T> CompressedSource<T> from(FileBasedSource<T> sourceDelegate) { return new CompressedSource<>(sourceDelegate, CompressionMode.AUTO); }
/** * Return a {@code CompressedSource} that is like this one but will decompress its underlying file * with the given {@link DecompressingChannelFactory}. */ public CompressedSource<T> withDecompression(DecompressingChannelFactory channelFactory) { return new CompressedSource<>(this.sourceDelegate, channelFactory); }
/** * Creates a {@code CompressedSource} for a subrange of a file. Called by superclass to create a * source for a single file. */ @Override protected FileBasedSource<T> createForSubrangeOfFile(Metadata metadata, long start, long end) { return new CompressedSource<>( sourceDelegate.createForSubrangeOfFile(metadata, start, end), channelFactory, metadata, sourceDelegate.getMinBundleSize(), start, end); }