Modifies ObjectReader so that when it encounters a primitive typed member in
an object stream which has no corresponding member in the app domain, it will
read the value anyway and throw it away. That way it can read the next block
from the stream.
Added a unit test which passes with the changes to ObjectReader.
Fixes bug #641821.
This commit includes unit tests that were run in MS.NET > 2.0.
The old behaviour of MS.NET 1.1 is still included in the patch
as an ONLY_1_1 define, to be backport-friendly to other branches
(but can be removed from now on in next commits, as mono master
doesn't include this profile anymore). Fixes BNC#324144.
* ObjectReader.cs (ReadType, GetDeserializationType):
Add throwOnError parameter that specifies whether to throw an
exception if the type/assembly is not found.
* ObjectReader.cs (ReadTypeMetadata): Ignore unresolvable
types while reading the type info. Fixes#430583.
* ObjectReader.cs (GetDeserializationType): Rethrow caught
exceptions as SerializationExceptions.
svn path=/trunk/mcs/; revision=152579
* BinaryFormatter.cs: NoCheckDeserialize() was using PeekChar() on a
reader when it should only read 1 byte. Also BinaryReader.PeekChar()
tries to set the position of hte stream back to where it was before
the read, which does not work well with broken Stream
implementations like BZip2InputStream (reports CanSeek is true when
it really can't seek). Now we do a Read() and then pass the value we
read on to the next methods.
* MessageFormatter.cs:
* ObjectReader.cs: added overloads that take a BinaryElement instead
of reading it from the reader. Only for the methods used in
NoCheckDeserialize.
Fixes bug #503435.
svn path=/trunk/mcs/; revision=142963
* corlib_test.dll: Add S.R.S/SerializationTest2.cs
In System.Runtime.Serialization.Formatters.Binary:
2008-09-17 Robert Jordan <[email protected]>>
* ObjectReader.cs (ReadTypeMetadata): Replace the check for
ISerializable with something less `reflective'.
Fixes#421664.
In Test/System.Runtime.Serialization:
2008-09-17 Robert Jordan <[email protected]>
* SerializationTest2.cs: Add test case for bug #421664.
svn path=/trunk/mcs/; revision=113278
2007-08-25 Robert Jordan <[email protected]>
* DateTime.cs: Implement internal To/FromBinary for the 1.1 profile.
In System.Runtime.Serialization.Formatters.Binary:
2007-08-25 Robert Jordan <[email protected]>
* ObjectReader.cs, ObjectWriter.cs, CodeGenerator.cs:
Use DateTime.From/ToBinary. Fixes#82400.
svn path=/trunk/mcs/; revision=84839
2007-08-23 Robert Jordan <[email protected]>
* corlib.dll.sources: Added MemberInfoSerializationHolder.cs.
In System.Runtime.Serialization.Formatters.Binary:
2007-08-23 Robert Jordan <[email protected]>
* ObjectReader.cs, ObjectReader.cs: Map between System.MonoType[] and
MS.NET's System.RuntimeType[].
* ObjectReader.cs (ReadType): When a type couldn't be found, emit
a more useful exception.
In System.Reflection:
2007-08-23 Robert Jordan <[email protected]>
* MemberInfoSerializationHolder.cs: created from
ReflectionSerializationHolder to match MS (fixes bug #80761).
Add support for fields, events, properties and generic methods.
* MonoMethod.cs (GetObjectData): handle generic arguments.
* MonoGenericMethod.cs: mark as [Serializable].
* MonoProperty.cs (GetObjectData): implemented.
* MonoField.cs: ditto.
* MonoEvent.cs: ditto.
svn path=/trunk/mcs/; revision=84732
2006-12-25 Robert Jordan <[email protected]>
* MethodCall.cs: Add support for generic methods.
* MethodCall.cs (GetTypeNameFromAssemblyQualifiedName):
Add support for generic types.
* ReturnMessage.cs: Fix bug #80371.
In System.Runtime.Serialization.Formatters.Binary:
2006-12-25 Robert Jordan <[email protected]>
* binary_serialization_format.htm: Update the NET_2_0 format.
* BinaryCommon.cs: MethodFlags is actually an int32. Add NET_2_0 flags.
* MessageFormatter.cs: Add support for generic method arguments.
* ObjectWriter.cs, ObjectReader.cs: Map between System.MonoType and
MS.NET's System.RuntimeType.
svn path=/trunk/mcs/; revision=70683
Fix#79159
* ObjectWriter.cs (WritePrimitiveTypeArray) [NET_2_0]: Encode the
'Kind' of each DateTime.
* ObjectReader.cs (ReadArrayOfPrimitiveType) [NET_2_0]: Decode the
'Kind' of each DateTime.
In Test/System.Runtime.Serialization.Formatters.Binary:
* BinaryFormatterTest.cs (DateTimeArray): New test for
round-tripping DateTime arrays.
svn path=/trunk/mcs/; revision=64929
* BinaryCommon.cs: Added helper method for swapping bytes.
* ObjectReader.cs:
* ObjectWriter.cs: Implemented serialization of arrays of primitive
types using Buffer.BlockCopy to create byffers of data that is written/
read in a single call. It's much faster now.
svn path=/trunk/mcs/; revision=42162
* BinaryCommon.cs: Found the meaning of two unknown binary elements.
* CodeGenerator.cs: Derive generated classes from ClrTypeMetadata
instead of TypeMetadata. Added writeTypes parameter to WriteTypeData().
* ObjectWriter.cs: Use type and assembly names as keys for the type and
assembly caches. This is needed since ISerializable types can provide
fake type names (which are mapped to real types by a binder on
deserialization).
Implemented support for BinaryFormatter.TypeFormat.
* BinaryFormatter.cs, MessageFormatter.cs: Implemented support for
TypeFormat property.
* ObjectReader.cs: Added support for objects serialized without
member type information. This fixes bug #73114.
If a binder return null, use the default way of loading the type.
svn path=/trunk/mcs/; revision=41404
* ObjectReader.cs: In ReadArrayOfPrimitiveType, added a specific
read loop for each type. It's much faster and avoids value boxings.
svn path=/trunk/mcs/; revision=41196
* ObjectReader.cs: Use GetField instead of GetMembers. Properties can't
be serialized, so it makes no sense to use GetMembers.
svn path=/trunk/mcs/; revision=37783
not necessary to query them for every object.
* ObjectWriter.cs: If the value being serialized is a value type (not boxed)
then there is no need to register it in the ObjectIDGenerator, because it is
not possible to have two references to the same value type object.
svn path=/trunk/mcs/; revision=16342
deserialized object and the headers.
* MessageFormatter.cs: The result of the call to the HeaderHandler delegate is
now interpreted as the uri of the target object. This seems to be MS.NET
behavior.
* BinaryFormatter.cs: Deserialize now calls the HeaderHandler delegate,
if provided.
svn path=/trunk/mcs/; revision=14559
* ObjectReader.cs (ReadNextObject): Call
RaiseDeserializationEvent() on the ObjectManager when we're done
reading the whole graph.
svn path=/trunk/mcs/; revision=10873