Ejemplo n.º 1
0
 public ReaderForCompress(string inputFile, IChunkQueue readBuffer, int bufferSize, Canceler canceler)
 {
     this.inputFile  = inputFile;
     this.readBuffer = readBuffer;
     this.bufferSize = bufferSize;
     this.Canceler   = canceler;
 }
Ejemplo n.º 2
0
 public Decompressor(IChunkQueue readBuffer, IChunkQueue writeBuffer, int bufferSize, Canceler canceler)
 {
     this.readBuffer  = readBuffer;
     this.writeBuffer = writeBuffer;
     this.bufferSize  = bufferSize;
     this.Canceler    = canceler;
 }
Ejemplo n.º 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();
            }
        }
Ejemplo n.º 4
0
 public Gzipper(string input, string output, Canceler cancr)
 {
     inputFile  = input;
     outputFile = output;
     canceler   = cancr;
 }
Ejemplo n.º 5
0
 public WriterForCompress(string outputFile, IChunkQueue writeBuffer, Canceler canceler)
 {
     this.outputFile  = outputFile;
     this.writeBuffer = writeBuffer;
     this.Canceler    = canceler;
 }
Ejemplo n.º 6
0
 public Compressor(IChunkQueue readBuffer, IChunkQueue writeBuffer, Canceler canceler)
 {
     this.readBuffer  = readBuffer;
     this.writeBuffer = writeBuffer;
     this.Canceler    = canceler;
 }