コード例 #1
0
 public byte[] Serialize(JT809Package jT809Package, int minBufferSize = 4096)
 {
     byte[] buffer = JT809ArrayPool.Rent(minBufferSize);
     try
     {
         JT809MessagePackWriter jT809MessagePackWriter = new JT809MessagePackWriter(buffer);
         JT809PackageFormatter.Instance.Serialize(ref jT809MessagePackWriter, jT809Package, jT809Config);
         return(jT809MessagePackWriter.FlushAndGetEncodingArray());
     }
     finally
     {
         JT809ArrayPool.Return(buffer);
     }
 }
コード例 #2
0
ファイル: JT809Serializer.cs プロジェクト: ironmp/JT809
 public static byte[] Serialize(JT809Package jT809Package, int minBufferSize = 1024)
 {
     return(Serialize <JT809Package>(jT809Package, minBufferSize));
 }