/** * Create writer with a specified configuration. * <p> * Objects for packing are specified in {@link #preparePack(Iterator)} or * {@link #preparePack(ProgressMonitor, Set, Set)}. * * @param config * configuration for the pack writer. * @param reader * reader to read from the repository with. * @param statsAccumulator * accumulator for statics */ public PackWriter(PackConfig config, final ObjectReader reader, @Nullable PackStatistics.Accumulator statsAccumulator) { this.config = config; this.reader = reader; if (reader instanceof ObjectReuseAsIs) reuseSupport = ((ObjectReuseAsIs) reader); else reuseSupport = null; deltaBaseAsOffset = config.isDeltaBaseAsOffset(); reuseDeltas = config.isReuseDeltas(); reuseValidate = true; // be paranoid by default stats = statsAccumulator != null ? statsAccumulator : new PackStatistics.Accumulator(); state = new MutableState(); selfRef = new WeakReference<>(this); instances.put(selfRef, Boolean.TRUE); }
/** * Create writer with a specified configuration. * <p> * Objects for packing are specified in {@link #preparePack(Iterator)} or * {@link #preparePack(ProgressMonitor, Set, Set)}. * * @param config * configuration for the pack writer. * @param reader * reader to read from the repository with. */ public PackWriter(final PackConfig config, final ObjectReader reader) { this.config = config; this.reader = reader; if (reader instanceof ObjectReuseAsIs) reuseSupport = ((ObjectReuseAsIs) reader); else reuseSupport = null; deltaBaseAsOffset = config.isDeltaBaseAsOffset(); reuseDeltas = config.isReuseDeltas(); reuseValidate = true; // be paranoid by default stats = new PackStatistics.Accumulator(); state = new MutableState(); selfRef = new WeakReference<PackWriter>(this); instances.put(selfRef, Boolean.TRUE); }
/** * Create writer with a specified configuration. * <p> * Objects for packing are specified in {@link #preparePack(Iterator)} or * {@link #preparePack(ProgressMonitor, Set, Set)}. * * @param config * configuration for the pack writer. * @param reader * reader to read from the repository with. * @param statsAccumulator * accumulator for statics */ public PackWriter(PackConfig config, final ObjectReader reader, @Nullable PackStatistics.Accumulator statsAccumulator) { this.config = config; this.reader = reader; if (reader instanceof ObjectReuseAsIs) reuseSupport = ((ObjectReuseAsIs) reader); else reuseSupport = null; deltaBaseAsOffset = config.isDeltaBaseAsOffset(); reuseDeltas = config.isReuseDeltas(); reuseValidate = true; // be paranoid by default stats = statsAccumulator != null ? statsAccumulator : new PackStatistics.Accumulator(); state = new MutableState(); selfRef = new WeakReference<>(this); instances.put(selfRef, Boolean.TRUE); }