/// <summary>
        /// Deserializes the given object from bytes
        /// </summary>
        /// <param name="bytes">The bytes to deserialize</param>
        /// <returns>The object</returns>
        /// <seealso cref="Org.IdentityConnectors.Framework.Common.Serializer.ObjectSerializerFactory" />
        public static object DeserializeBinaryObject(byte[] bytes)
        {
            ObjectSerializerFactory  fact = ObjectSerializerFactory.GetInstance();
            MemoryStream             mem  = new MemoryStream(bytes);
            BinaryObjectDeserializer des  = fact.NewBinaryDeserializer(mem);

            return(des.ReadObject());
        }
Ejemplo n.º 2
0
        private void Init(TcpClient socket, Stream stream)
        {
            _socket = socket;
            _stream = stream;
            ObjectSerializerFactory fact =
                ObjectSerializerFactory.GetInstance();

            _encoder = fact.NewBinarySerializer(_stream);
            _decoder = fact.NewBinaryDeserializer(_stream);
        }
Ejemplo n.º 3
0
 private void Init(TcpClient socket, Stream stream)
 {
     _socket = socket;
     _stream = stream;
     ObjectSerializerFactory fact =
         ObjectSerializerFactory.GetInstance();
     _encoder = fact.NewBinarySerializer(_stream);
     _decoder = fact.NewBinaryDeserializer(_stream);
 }