コード例 #1
0
ファイル: CSEBMLSpeedTest.cs プロジェクト: arucard21/AniDB
        public void Start(string filePath, int blockSize, int blockCount)
        {
            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));
            buffer = new RefillBuffer<byte[]>(circb, blockSource, 1);
            buffer.Start();

            (new Thread(Speed)).Start();
            DummyRead();

            finished = true;
        }
コード例 #2
0
        public void Start(string filePath, int blockSize, int blockCount)
        {
            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));

            buffer = new RefillBuffer <byte[]>(circb, blockSource, 1);
            buffer.Start();

            (new Thread(Speed)).Start();
            DummyRead();

            finished = true;
        }
コード例 #3
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;
        }
コード例 #4
0
ファイル: CSEBMLSpeedTest.cs プロジェクト: arucard21/AniDB
        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;
        }