コード例 #1
0
ファイル: AMF3Protocol.cs プロジェクト: jjcz123456/CardTK
 public ByteArray GetBytes()
 {
     if (writeObject == null) throw new Exception("write object is null");
     var byteArray = new ByteArray();
     byteArray.WriteObject(writeObject);
     return byteArray;
 }
コード例 #2
0
ファイル: Common.cs プロジェクト: GoodManGoodGhost/DoWan
 /// <summary>
 /// AS的int转byte[]
 /// </summary>
 /// <param name="i"></param>
 /// <returns></returns>
 public static byte[] ASIntToByte(uint i)
 {
     ByteArray ba = new ByteArray();
     ba.WriteObject(i);
     byte[] ss = new byte[16];
     ba.Position = 1;
     ba.ReadBytes(ss, 0, (uint)ss.Length);
     byte[] rs = new byte[ba.Length - 1];
     for (int j = 0; j < rs.Length; j++)
         rs[j] = ss[j];
     return rs;
 }