Esempio n. 1
0
        /// <summary>
        /// Initialise a TarArchive for output.
        /// </summary>
        /// <param name="stream">The <see cref="TarOutputStream"/> to use for output.</param>
        protected TarArchive(TarOutputStream stream)
        {
            if (stream == null)
            {
                throw new ArgumentNullException("stream");
            }

            tarOut = stream;
        }
Esempio n. 2
0
        /// <summary>
        /// Create a TarArchive for writing to, using the default blocking factor
        /// </summary>
        /// <param name="outputStream">The <see cref="Stream"/> to write to</param>
        /// <returns>Returns a <see cref="TarArchive"/> suitable for writing.</returns>
        public static TarArchive CreateOutputTarArchive(Stream outputStream)
        {
            if (outputStream == null)
            {
                throw new ArgumentNullException("outputStream");
            }

            TarOutputStream tarStream = outputStream as TarOutputStream;

            TarArchive result;

            if (tarStream != null)
            {
                result = new TarArchive(tarStream);
            }
            else
            {
                result = CreateOutputTarArchive(outputStream, TarBuffer.DefaultBlockFactor);
            }
            return(result);
        }
Esempio n. 3
0
        /// <summary>
        /// Initialise a TarArchive for output.
        /// </summary>
        /// <param name="stream">The <see cref="TarOutputStream"/> to use for output.</param> 
        protected TarArchive(TarOutputStream stream)
        {
            if (stream == null)
            {
                throw new ArgumentNullException("stream");
            }

            tarOut = stream;
        }