natix.CompactDS.OctetStream.Read C# (CSharp) Method

Read() public method

Read the current value at Position, then increments ctx.Offset
public Read ( Context ctx ) : byte
ctx Context
return byte
        public byte Read(Context ctx)
        {
            var v = this.buff [ctx.Offset];
            ++ctx.Offset;
            return v;
        }

Usage Example

Esempio n. 1
0
 public long Decode(OctetStream reader, OctetStream.Context ctx)
 {
     long d = 0;
     int p = 0;
     while (true) {
         long m = reader.Read (ctx);
         d |= (m & 127) << p;
         if ((m & 128) != 0) {
             break;
         }
         p += 7;
     }
     return d;
 }