Exemplo n.º 1
0
Arquivo: Bytes.cs Projeto: nunun/Xnet
 public void WriteUInt16BE(ushort v)
 {
     int nextpos = this.tailpos + 2;
     if (nextpos < this.maxLength || this.Extend()) {
         NetworkValue nv = new NetworkValue();
         Array.Copy(BitConverter.GetBytes(nv.HTONUS(v)), 0, accessor, this.tailpos, 2);
         this.tailpos = nextpos;
         this.length += 2;
     }
 }
Exemplo n.º 2
0
Arquivo: Bytes.cs Projeto: nunun/Xnet
 public void PrependUInt16BE(ushort v)
 {
     int nextpos = this.headpos - 2;
     if (nextpos >= 0) {
         NetworkValue nv = new NetworkValue();
         Array.Copy(BitConverter.GetBytes(nv.HTONUS(v)), 0, accessor, nextpos, 2);
         this.headpos = nextpos;
         this.length += 2;
     }
 }