예제 #1
0
        private BinaryDataPacket[] Encode(IReadOnlyList <DataPacket> data)
        {
            if (data == null)
            {
                return(null);
            }

            var encoded = new BinaryDataPacket[data.Count];

            for (var i = 0; i < data.Count; ++i)
            {
                encoded[i] = new BinaryDataPacket(data[i].Header, _byteEncoder.Encode(data[i].Body));
            }
            return(encoded);
        }
예제 #2
0
 protected byte[] Encode(object data)
 {
     return(data == null ? null : _byteEncoder.Encode(data));
 }