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