public string Encode(byte[] binary) { string data = string.Empty; BinaryEncoder encoder = new BinaryEncoder(); try { switch (m_EncodeForamt) { case Algorithm.StringTransformationFormat.Base64: { data = encoder.EncodeBinaryToBase64(binary); break; } case Algorithm.StringTransformationFormat.UTF8: { data = encoder.EncodeBinaryToUTF8(binary); break; } } } catch (Exception) { throw; } return(data); }