Пример #1
0
        public void Start(string filePath, int blockSize, int blockCount)
        {
            var fileStream  = System.IO.File.Open(filePath, System.IO.FileMode.Open, System.IO.FileAccess.Read, System.IO.FileShare.Read);
            var blockSource = new ByteStreamToBlock(fileStream, blockSize);
            var circb       = new CircularBuffer <byte[]>((int)Math.Log(blockCount, 2));
            var buffer      = new RefillBuffer <byte[]>(circb, blockSource, 1);

            buffer.Start();


            src = new FileSource(buffer, 0);
            var docType = new DocTypeEBML(new DocTypeMatroskaV2());
            var reader  = new EBMLReader(src, docType);

            //while(circb.ProducerCanWrite() && fileStream.Position != fileStream.Length) Thread.Sleep(20);


            (new Thread(Speed)).Start();
            SpeedRecurse(reader);
            finished = true;
        }
Пример #2
0
        public void Start(string filePath, int blockSize, int blockCount)
        {
            var fileStream = System.IO.File.Open(filePath, System.IO.FileMode.Open, System.IO.FileAccess.Read, System.IO.FileShare.Read);
            var blockSource = new ByteStreamToBlock(fileStream, blockSize);
            var circb = new CircularBuffer<byte[]>((int)Math.Log(blockCount, 2));
            var buffer = new RefillBuffer<byte[]>(circb, blockSource, 1);
            buffer.Start();

            src = new FileSource(buffer, 0);
            var docType = new DocTypeEBML(new DocTypeMatroskaV2());
            var reader = new EBMLReader(src, docType);

            //while(circb.ProducerCanWrite() && fileStream.Position != fileStream.Length) Thread.Sleep(20);

            (new Thread(Speed)).Start();
            SpeedRecurse(reader);
            finished = true;
        }