示例#1
0
        private void FillBuffer()
        {
            bufferStream = new MemoryStream();
            BinaryWriter binaryWriter = new BinaryWriter(bufferStream);

            for (int i = 0; i < 100; i++)
            {
                byte[] array = inputReader.ReadBytes(settings.BlockLength);
                if (array.Length != 0)
                {
                    SignatureHelpers.WriteBlock(binaryWriter, array, settings);
                }
            }
            binaryWriter.Flush();
            bufferStream.Seek(0L, SeekOrigin.Begin);
        }
示例#2
0
        private void FillBuffer()
        {
            this.bufferStream = new MemoryStream();
            var writer = new BinaryWriter(this.bufferStream);

            for (int i = 0; i < BlocksToBuffer; i++)
            {
                var block = this.inputReader.ReadBytes(this.settings.BlockLength);
                if (block.Length != 0)
                {
                    SignatureHelpers.WriteBlock(writer, block, this.settings);
                }
            }

            writer.Flush();
            this.bufferStream.Seek(0, SeekOrigin.Begin);
        }