Esempio n. 1
0
 /// <summary>
 /// Extracts a serializable object from the stream.
 /// </summary>
 /// <returns>The serializable object.</returns>
 public object readSerializable()
 {
     int sz = readAndCheckSeqSize(1);
     if(sz == 0)
     {
         return null;
     }
     try
     {
         IceInternal.InputStreamWrapper w = new IceInternal.InputStreamWrapper(sz, this);
         IFormatter f = new BinaryFormatter();
         return f.Deserialize(w);
     }
     catch(System.Exception ex)
     {
         throw new Ice.MarshalException("cannot deserialize object:", ex);
     }
 }
Esempio n. 2
0
 /// <summary>
 /// Extracts a serializable object from the stream.
 /// </summary>
 /// <returns>The serializable object.</returns>
 public object readSerializable()
 {
     #if !COMPACT && !SILVERLIGHT
     int sz = readAndCheckSeqSize(1);
     if(sz == 0)
     {
         return null;
     }
     try
     {
         IceInternal.InputStreamWrapper w = new IceInternal.InputStreamWrapper(sz, this);
         IFormatter f = new BinaryFormatter();
         return f.Deserialize(w);
     }
     catch(System.Exception ex)
     {
         throw new Ice.MarshalException("cannot deserialize object:", ex);
     }
     #else
     throw new Ice.MarshalException("serialization not supported");
     #endif
 }