Ejemplo n.º 1
0
 public DryadLinqMultiReaderStream(DryadLinqBinaryReader[] streamArray)
 {
     this.m_inputStreamArray = streamArray;
     this.m_curStream = streamArray[0];
     this.m_nextStreamIdx = 1;
 }
Ejemplo n.º 2
0
 public override int Read(byte[] buffer, int offset, int count)
 {
     while (true)
     {
         int n = this.m_curStream.ReadBytes(buffer, offset, count);
         if (n != 0) return n;
         if (this.m_nextStreamIdx == this.m_inputStreamArray.Length) return 0;
         this.m_curStream = this.m_inputStreamArray[this.m_nextStreamIdx++];
     }
 }
Ejemplo n.º 3
0
 public override int ReadByte()
 {
     while (true)
     {
         int b = this.m_curStream.ReadUByte();
         if (b != -1) return b;
         if (this.m_nextStreamIdx == this.m_inputStreamArray.Length) return -1;
         this.m_curStream = this.m_inputStreamArray[this.m_nextStreamIdx++];
     }
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Reads a BitVector from the specified DryadLinqBinaryReader. 
 /// </summary>
 /// <param name="reader">The DryadLinqBinaryReader to read from.</param>
 /// <returns>A BitVector</returns>
 public static BitVector Read(DryadLinqBinaryReader reader)
 {
     Int32 len = reader.ReadCompactInt32();
     byte[] values = new byte[len];
     for (int i = 0; i < len; i++)
     {
         values[i] = reader.ReadUByte();
     }
     return new BitVector(values);
 }