示例#1
0
        private void ReadUncompressed()
        {
            using (var stream = File.Open(_filePath, FileMode.Open, FileAccess.Read))
            {
                int id = 1;
                while (stream.Position < stream.Length)
                {
                    var arraySize = GetBlockSize(stream.Length, stream.Position);
                    var byteArray = new byte[arraySize];
                    stream.Read(byteArray, 0, arraySize);

                    var block = new ByteBlock(id, byteArray);
                    _queue.Enqueue(block);
                    id++;
                }

                _queueDispatcher.CloseQueue();
            }
        }
示例#2
0
 private void Archive()
 {
     try
     {
         DoWorkImpl();
         _queueDispatcher.CloseQueue();
     }
     catch (Exception ex)
     {
         Logger.Instance.WriteError(ex);
         return;
     }
 }