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); }
protected byte[] Encode(object data) { return(data == null ? null : _byteEncoder.Encode(data)); }