public ReaderForCompress(string inputFile, IChunkQueue readBuffer, int bufferSize, Canceler canceler)
 {
     this.inputFile  = inputFile;
     this.readBuffer = readBuffer;
     this.bufferSize = bufferSize;
     this.Canceler   = canceler;
 }
示例#2
0
 public Decompressor(IChunkQueue readBuffer, IChunkQueue writeBuffer, int bufferSize, Canceler canceler)
 {
     this.readBuffer  = readBuffer;
     this.writeBuffer = writeBuffer;
     this.bufferSize  = bufferSize;
     this.Canceler    = canceler;
 }
示例#3
0
        static void Main(string[] args)
        {
            var time = Stopwatch.StartNew();

            canceler = new Canceler();

            Console.CancelKeyPress += new ConsoleCancelEventHandler(cancelHandler);

            try
            {
                ValidateCommandLineInput(args);
                var mode       = args[0];
                var inputFile  = args[1];
                var outputFile = args[2];
                gzipper = new Gzipper(inputFile, outputFile, canceler);
                if (mode == "compress")
                {
                    gzipper.Compress();
                }
                else
                {
                    gzipper.Decompress();
                }


                Console.WriteLine($"time Elapsed - {time.Elapsed.TotalSeconds}");
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
                canceler.Cancel();
            }
        }
示例#4
0
 public Gzipper(string input, string output, Canceler cancr)
 {
     inputFile  = input;
     outputFile = output;
     canceler   = cancr;
 }
 public WriterForCompress(string outputFile, IChunkQueue writeBuffer, Canceler canceler)
 {
     this.outputFile  = outputFile;
     this.writeBuffer = writeBuffer;
     this.Canceler    = canceler;
 }
示例#6
0
 public Compressor(IChunkQueue readBuffer, IChunkQueue writeBuffer, Canceler canceler)
 {
     this.readBuffer  = readBuffer;
     this.writeBuffer = writeBuffer;
     this.Canceler    = canceler;
 }