Exemple #1
0
        public void CreateStreams()
        {
            this.stream1 = new MemoryStream(this.buffer);
            this.stream2 = new MemoryStream(this.buffer);
            this.stream3 = new MemoryStream(this.buffer);
            this.stream4 = new MemoryStream(this.buffer);
            this.stream5 = new MemoryStream(this.buffer);
            this.stream6 = new MemoryStream(this.buffer);
            this.stream6 = new MemoryStream(this.buffer);

            this.chunkedMemoryStream1 = new ChunkedMemoryStream(Configuration.Default.MemoryAllocator);
            this.chunkedMemoryStream1.Write(this.buffer);
            this.chunkedMemoryStream1.Position = 0;

            this.chunkedMemoryStream2 = new ChunkedMemoryStream(Configuration.Default.MemoryAllocator);
            this.chunkedMemoryStream2.Write(this.buffer);
            this.chunkedMemoryStream2.Position = 0;

            this.bufferedStream1     = new BufferedReadStream(Configuration.Default, this.stream3);
            this.bufferedStream2     = new BufferedReadStream(Configuration.Default, this.stream4);
            this.bufferedStream3     = new BufferedReadStream(Configuration.Default, this.chunkedMemoryStream1);
            this.bufferedStream4     = new BufferedReadStream(Configuration.Default, this.chunkedMemoryStream2);
            this.bufferedStreamWrap1 = new BufferedReadStreamWrapper(this.stream5);
            this.bufferedStreamWrap2 = new BufferedReadStreamWrapper(this.stream6);
        }
Exemple #2
0
        public int BufferedReadStreamWrapReadByte()
        {
            int r = 0;
            BufferedReadStreamWrapper reader = this.bufferedStreamWrap2;

            for (int i = 0; i < reader.Length; i++)
            {
                r += reader.ReadByte();
            }

            return(r);
        }
Exemple #3
0
 public void CreateStreams()
 {
     this.stream1             = new MemoryStream(this.buffer);
     this.stream2             = new MemoryStream(this.buffer);
     this.stream3             = new MemoryStream(this.buffer);
     this.stream4             = new MemoryStream(this.buffer);
     this.stream5             = new MemoryStream(this.buffer);
     this.stream6             = new MemoryStream(this.buffer);
     this.bufferedStream1     = new BufferedReadStream(Configuration.Default, this.stream3);
     this.bufferedStream2     = new BufferedReadStream(Configuration.Default, this.stream4);
     this.bufferedStreamWrap1 = new BufferedReadStreamWrapper(this.stream5);
     this.bufferedStreamWrap2 = new BufferedReadStreamWrapper(this.stream6);
 }
Exemple #4
0
        public int BufferedReadStreamWrapRead()
        {
            int r = 0;
            BufferedReadStreamWrapper reader = this.bufferedStreamWrap1;

            byte[] b = this.chunk2;

            for (int i = 0; i < reader.Length / 2; i++)
            {
                r += reader.Read(b, 0, 2);
            }

            return(r);
        }