public LongStream(LongStream longstream) { this.ostream = new OctetStream (longstream.ostream); this.offsets = longstream.offsets; this.count = longstream.count; this.ctx = new OctetStream.Context (); }
public LongStream() { this.ostream = new OctetStream (); this.offsets = new List<int> (); this.count = 0; this.ctx = new OctetStream.Context (); }
public void Encode(long d, OctetStream Output) { long m; while (true) { m = d & 127; d >>= 7; if (d == 0) { Output.Add ((byte)(m | 128)); break; } else { Output.Add ((byte) m); } } }
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; }
public OctetStream(OctetStream oct_stream) { this.buff = oct_stream.buff; }
public void Decompress(List<long> list, OctetStream.Context ctx, int count) { for (int i = 0; i < count; ++i) { var u = CODER.Decode (this.ostream, ctx); list.Add (u); } }