예제 #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
 public static byte[] Serialize(JT809Package jT809Package, int minBufferSize = 1024)
 {
     return(Serialize <JT809Package>(jT809Package, minBufferSize));
 }