protected void ReadInto(IReadContext context, ArrayInfo info, object array) { if (array == null) { return; } if (HandleAsByteArray(array)) { context.ReadBytes((byte[])array); // byte[] performance optimisation return; } if (HasNullBitmap(info)) { BitMap4 nullBitMap = ReadNullBitmap(context, info.ElementCount()); for (int i = 0; i < info.ElementCount(); i++) { object obj = nullBitMap.IsTrue(i) ? null : context.ReadObject(_handler); ArrayReflector(Container(context)).Set(array, i, obj); } } else { for (int i = 0; i < info.ElementCount(); i++) { ArrayReflector(Container(context)).Set(array, i, context.ReadObject(_handler)); } } }
public object Read(IReadContext context) { var wrapper = (PSObjectWrapper)context.ReadObject(TypeHandler()); PSObject obj = (PSObject)((UnmarshallingContext)context).PersistentObject(); return(wrapper.Original(obj, context.ObjectContainer())); }
private static void ReadElements(IReadContext context, ICollectionInitializer initializer, ITypeHandler4 elementHandler) { int elementCount = context.ReadInt(); for (int i = 0; i < elementCount; i++) { initializer.Add(context.ReadObject(elementHandler)); } }
public override object Read(IReadContext context) { return context.ReadObject(); }
public override object Read(IReadContext context) { return(context.ReadObject()); }
public object Read(IReadContext context) { var wrapper = (PSObjectWrapper)context.ReadObject(TypeHandler()); PSObject obj = (PSObject) ((UnmarshallingContext) context).PersistentObject(); return wrapper.Original(obj, context.ObjectContainer()); }