/// <summary> /// Construct TarBuffer for writing Tar output to streams. /// </summary> /// <param name="outputStream">Output stream to write to.</param> /// <param name="blockFactor">Blocking factor to apply</param> /// <returns>TarBuffer</returns> public static TarBuffer CreateOutputTarBuffer(Stream outputStream, int blockFactor) { TarBuffer tarBuffer = new TarBuffer(); tarBuffer.inputStream = null; tarBuffer.outputStream = outputStream; tarBuffer.Initialize(blockFactor); return tarBuffer; }
/// <summary> /// Construct a TarInputStream with user specified block factor /// </summary> /// <param name="inputStream">stream to source data from</param> /// <param name="blockFactor">block factor to apply to archive</param> public TarInputStream(Stream inputStream, int blockFactor) { this.inputStream = inputStream; this.buffer = TarBuffer.CreateInputTarBuffer(inputStream, blockFactor); this.readBuf = null; this.hasHitEOF = false; this.eFactory = null; }
/// <summary> /// Construct TarOutputStream with user specified block factor /// </summary> /// <param name="outputStream">stream to write to</param> /// <param name="blockFactor">blocking factor</param> public TarOutputStream(Stream outputStream, int blockFactor) { this.outputStream = outputStream; this.buffer = TarBuffer.CreateOutputTarBuffer(outputStream, blockFactor); this.debug = false; this.assemLen = 0; this.assemBuf = new byte[TarBuffer.BlockSize]; this.blockBuf = new byte[TarBuffer.BlockSize]; }