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

Add() public method

Add a sequence of values to the end of the stream. Returns the first insertion position. Empty arrays will return the insertion position anyway of a non empty array.
public Add ( IEnumerable array ) : int
array IEnumerable
return int
        public int Add(IEnumerable<byte> array)
        {
            var pos = this.buff.Count;
            foreach (var a in array) {
                this.buff.Add (a);
            }
            return pos;
        }

Same methods

OctetStream::Add ( byte b ) : int

Usage Example

Esempio n. 1
0
 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);
         }
     }
 }