public T Decode <T>(byte[] data, int offset, int count) { if (data == null) { throw new ArgumentNullException("The data to be deserialized cannot be null."); } if (CompressionEnabled) { return(ProtocolBuffersConvert.DeserializeObject <T>(GZipCompression.Decompress(data, offset, count))); } else { return(ProtocolBuffersConvert.DeserializeObject <T>(data, offset, count)); } }
public T DecodeMessage <T>(byte[] data, int dataOffset, int dataLength) { if (data == null) { throw new ArgumentNullException("The data which is to be deserialized cannot be null."); } if (CompressionEnabled) { return(ProtocolBuffersConvert.DeserializeObject <T>(GZipCompression.Decompress(data, dataOffset, dataLength))); } else { return(ProtocolBuffersConvert.DeserializeObject <T>(data, dataOffset, dataLength)); } }