Exemplo n.º 1
0
        public override void WriteBytes()
        {
            var writedBlockCount = 0;

            while (!OutputQueue.Completed() && !ForceStopped)
            {
                var bytesBlock = OutputQueue.Pop();
                if (bytesBlock == null)
                {
                    continue;
                }

                var binaryFormatter = new BinaryFormatter();
                binaryFormatter.Serialize(FsOutput, bytesBlock);

                ++writedBlockCount;
                if (InputQueue.Completed() && ReadedBlockCount == writedBlockCount)
                {
                    OutputQueue.Complete();
                }
            }
        }
Exemplo n.º 2
0
        public override void WriteBytes()
        {
            var writedBlockCount = 0;

            while (!OutputQueue.Completed() && !ForceStopped)
            {
                var bytesBlock = OutputQueue.Pop();
                if (bytesBlock == null)
                {
                    continue;
                }

                FsOutput.Seek(Convert.ToInt32(BlockProcessingLength) * bytesBlock.OrderNum, SeekOrigin.Begin);
                FsOutput.Write(bytesBlock.BytesArray, 0, bytesBlock.BytesArray.Length);

                ++writedBlockCount;
                if (InputQueue.Completed() && ReadedBlockCount == writedBlockCount)
                {
                    OutputQueue.Complete();
                }
            }
        }