Exemplo n.º 1
0
Arquivo: Bytes.cs Projeto: nunun/Xnet
 /**
  * 情報を書き込みます (Int32/UInt32)
  * Big Endian (Network Byte Order) を使用します。
  */
 public void WriteInt32BE(int v)
 {
     int nextpos = this.tailpos + 4;
     if (nextpos < this.maxLength || this.Extend()) {
         NetworkValue nv = new NetworkValue();
         Array.Copy(BitConverter.GetBytes(nv.HTONI(v)), 0, accessor, this.tailpos, 4);
         this.tailpos = nextpos;
         this.length += 4;
     }
 }
Exemplo n.º 2
0
Arquivo: Bytes.cs Projeto: nunun/Xnet
 /**
  * 情報をヘッダに追加します (Int32/UInt32)
  * Big Endian (Network Byte Order) を使用します。
  */
 public void PrependInt32BE(int v)
 {
     int nextpos = this.headpos - 4;
     if (nextpos >= 0) {
         NetworkValue nv = new NetworkValue();
         Array.Copy(BitConverter.GetBytes(nv.HTONI(v)), 0, accessor, nextpos, 4);
         this.headpos = nextpos;
         this.length += 4;
     }
 }