Пример #1
0
 public override void Export(ContactWriter writer, Contact contact, OutboundVCardConverter.PropertyExporter.Context context)
 {
     byte[][] array = contact.TryGetProperty(InternalSchema.UserX509Certificates) as byte[][];
     if (array != null)
     {
         foreach (byte[] array3 in array)
         {
             if (array3 != null)
             {
                 writer.StartProperty(PropertyId.Key);
                 writer.WriteParameter(ParameterId.Type, "X509");
                 writer.WriteParameter(ParameterId.Encoding, "B");
                 using (MemoryStream memoryStream = new MemoryStream())
                 {
                     using (Stream stream = new EncoderStream(new StreamWrapper(memoryStream, false), new Base64Encoder(0), EncoderStreamAccess.Write))
                     {
                         stream.Write(array3, 0, array3.Length);
                     }
                     memoryStream.Position = 0L;
                     writer.WritePropertyValue(memoryStream);
                 }
             }
         }
     }
 }
Пример #2
0
        public void SylvanEncoderStream()
        {
            using var ms = new PooledMemoryStream();
            var es = new EncoderStream(ms, new Base64Encoder());

            es.Write(inputData, 0, inputData.Length);
            es.Close();
        }