public static System.Object deserialize(sbyte[] data, ExternalizableWrapper ew) { System.IO.MemoryStream bais = new System.IO.MemoryStream((byte[])(Array)data); try { return(read(new System.IO.BinaryReader(bais), ew)); } catch (System.IO.EndOfStreamException eofe) { throw new DeserializationException("Unexpectedly reached end of stream when deserializing"); } catch (System.IO.IOException udfe) { throw new DeserializationException("Unexpectedly reached end of stream when deserializing"); } finally { try { bais.Close(); } catch (System.IO.IOException e) { //already closed. Don't sweat it } } }
public static System.Object deserialize(sbyte[] data, ExternalizableWrapper ew) { System.IO.MemoryStream bais = new System.IO.MemoryStream(SupportClass.ToByteArray(data)); try { return(read(new System.IO.BinaryReader(bais), ew)); } catch (System.IO.EndOfStreamException eofe) { throw new DeserializationException("Unexpectedly reached end of stream when deserializing"); } catch (System.IO.IOException udfe) { throw new DeserializationException("Unexpectedly reached end of stream when deserializing"); } catch (System.IO.IOException e) { throw new System.SystemException("Unknown IOException reading from ByteArrayInputStream; shouldn't happen!"); } finally { try { bais.Close(); } catch (System.IO.IOException e) { //already closed. Don't sweat it } } }
public ExtWrapList(ExternalizableWrapper type) { if (type == null) { throw new System.NullReferenceException(); } this.type = type; this.sealed_Renamed = false; }
public ExtWrapMapPoly(ExternalizableWrapper keyType, bool ordered) { if (keyType == null) { throw new System.NullReferenceException(); } this.keyType = keyType; this.ordered = ordered; }
public ExtWrapMap(ExternalizableWrapper keyType, ExternalizableWrapper dataType, int type) { if (keyType == null || dataType == null) { throw new System.NullReferenceException(); } this.keyType = keyType; this.dataType = dataType; this.type = type; }
public ExtWrapList(System.Collections.ArrayList val, ExternalizableWrapper type) { if (val == null) { throw new System.NullReferenceException(); } this.val = val; this.type = type; this.sealed_Renamed = false; }
public ExtWrapList(List <SelectChoice> val, ExternalizableWrapper type) { if (val == null) { throw new System.NullReferenceException(); } this.val = val; this.type = type; this.sealed_Renamed = false; }
//UPGRADE_TODO: Class 'java.util.HashMap' was converted to 'System.Collections.Hashtable' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javautilHashMap'" public ExtWrapMapPoly(System.Collections.Hashtable val, ExternalizableWrapper keyType) { if (val == null) { throw new System.NullReferenceException(); } this.val = val; this.keyType = keyType; this.ordered = (val is OrderedMap); }
//UPGRADE_TODO: Class 'java.io.DataInputStream' was converted to 'System.IO.BinaryReader' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javaioDataInputStream'" public static ExternalizableWrapper readTag(System.IO.BinaryReader in_Renamed, PrototypeFactory pf) { sbyte[] tag = new sbyte[PrototypeFactory.CLASS_HASH_SIZE]; in_Renamed.Read((byte[])(Array)tag, 0, tag.Length); if (PrototypeFactory.compareHash(tag, WRAPPER_TAG)) { int wrapperCode = ExtUtil.readInt(in_Renamed); //find wrapper indicated by code ExternalizableWrapper type = null; foreach (Object key in WRAPPER_CODES.Keys) { System.Type t = (System.Type)key; if ((int)WRAPPER_CODES[key] == wrapperCode) { try { type = (ExternalizableWrapper)PrototypeFactory.getInstance(t); } catch (CannotCreateObjectException ccoe) { //UPGRADE_TODO: The equivalent in .NET for method 'java.lang.Class.getName' may return a different value. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1043'" throw new CannotCreateObjectException("Serious problem: cannot create built-in ExternalizableWrapper [" + t.FullName + "]"); } } } if (type == null) { throw new DeserializationException("Unrecognized ExternalizableWrapper type [" + wrapperCode + "]"); } type.metaReadExternal(in_Renamed, pf); return(type); } else { System.Type type = pf.getClass(tag); if (type == null) { throw new DeserializationException("No datatype registered to serialization code " + ExtUtil.printBytes((byte[])(Array)tag)); } return(new ExtWrapBase(type)); } }
/* serialization or deserialization, depending on context */ public ExtWrapNullable(ExternalizableWrapper type) { if (type is ExtWrapNullable) { throw new System.ArgumentException("Wrapping nullable with nullable is redundant"); } else if (type != null && type.Empty) { this.type = type; } else { this.val = type; } }
public ExtWrapMap(System.Collections.IDictionary val, ExternalizableWrapper keyType, ExternalizableWrapper dataType) { if (val == null) { throw new System.NullReferenceException(); } this.val = val; this.keyType = keyType; this.dataType = dataType; if (val is Map) { //TODO: check for sealed type = TYPE_SLOW_READ_ONLY; } else if (val is OrderedMap) { type = TYPE_ORDERED; } else { type = TYPE_NORMAL; } }
public ExtWrapMapPoly(ExternalizableWrapper keyType) : this(keyType, false) { }
public ExtWrapMap(System.Type keyType, ExternalizableWrapper dataType, int type) : this(new ExtWrapBase(keyType), dataType, type) { }
//UPGRADE_TODO: Class 'java.io.DataInputStream' was converted to 'System.IO.BinaryReader' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javaioDataInputStream'" public override void metaReadExternal(System.IO.BinaryReader in_Renamed, PrototypeFactory pf) { ordered = ExtUtil.readBool(in_Renamed); keyType = ExtWrapTagged.readTag(in_Renamed, pf); }
//UPGRADE_TODO: Class 'java.util.HashMap' was converted to 'System.Collections.Hashtable' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javautilHashMap'" public ExtWrapMap(System.Collections.Hashtable val, ExternalizableWrapper dataType) : this(val, null, dataType) { }
//UPGRADE_TODO: Class 'java.io.DataInputStream' was converted to 'System.IO.BinaryReader' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javaioDataInputStream'" public static System.Object read(System.IO.BinaryReader in_Renamed, ExternalizableWrapper ew) { return(read(in_Renamed, ew, null)); }
//UPGRADE_TODO: Class 'java.io.DataInputStream' was converted to 'System.IO.BinaryReader' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javaioDataInputStream'" public static System.Object read(System.IO.BinaryReader in_Renamed, ExternalizableWrapper ew, PrototypeFactory pf) { ew.readExternal(in_Renamed, pf == null?defaultPrototypes():pf); return(ew.val); }
//UPGRADE_TODO: Class 'java.io.DataInputStream' was converted to 'System.IO.BinaryReader' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javaioDataInputStream'" public override void readExternal(System.IO.BinaryReader in_Renamed, PrototypeFactory pf) { ExternalizableWrapper type = readTag(in_Renamed, pf); val = ExtUtil.read(in_Renamed, type, pf); }
//UPGRADE_TODO: Class 'java.io.DataInputStream' was converted to 'System.IO.BinaryReader' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javaioDataInputStream'" public override void metaReadExternal(System.IO.BinaryReader in_Renamed, PrototypeFactory pf) { type = ExtWrapTagged.readTag(in_Renamed, pf); }
public ExtWrapMap(ExternalizableWrapper keyType, ExternalizableWrapper dataType) : this(keyType, dataType, TYPE_NORMAL) { }
public static Object read(BinaryReader in_r, ExternalizableWrapper ew, PrototypeFactory pf) { ew.readExternal(in_r, pf == null ? defaultPrototypes() : pf); return(ew.val); }
public static Object read(BinaryReader in_r, ExternalizableWrapper ew) { return(read(in_r, ew, null)); }
public ExtWrapNullable(System.Type type) { this.type = new ExtWrapBase(type); }
public ExtWrapList(System.Type type, bool sealed_Renamed) { this.type = new ExtWrapBase(type); this.sealed_Renamed = sealed_Renamed; }