Beispiel #1
0
		/// <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)
		{
			if ( outputStream == null )
			{
				throw new ArgumentNullException("outputStream");
			}

			if ( blockFactor <= 0 )
			{
				throw new ArgumentOutOfRangeException("blockFactor", "Factor cannot be negative");
			}

			TarBuffer tarBuffer = new TarBuffer();
			tarBuffer.inputStream  = null;
			tarBuffer.outputStream = outputStream;
			tarBuffer.Initialize(blockFactor);
			
			return tarBuffer;
		}
Beispiel #2
0
 /// <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);
 }