Beispiel #1
0
        //UPGRADE_TODO: Class 'java.io.DataOutputStream' was converted to 'System.IO.BinaryWriter' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javaioDataOutputStream'"
        public static void  writeTag(System.IO.BinaryWriter out_Renamed, System.Object o)
        {
            if (o is ExternalizableWrapper && !(o is ExtWrapBase))
            {
                out_Renamed.Write(SupportClass.ToByteArray(WRAPPER_TAG), 0, PrototypeFactory.CLASS_HASH_SIZE);
                ExtUtil.writeNumeric(out_Renamed, WRAPPER_CODES.get_Renamed(o.GetType()));
                ((ExternalizableWrapper)o).metaWriteExternal(out_Renamed);
            }
            else
            {
                System.Type type = null;

                if (o is ExtWrapBase)
                {
                    ExtWrapBase extType = (ExtWrapBase)o;
                    if (extType.val != null)
                    {
                        o = extType.val;
                    }
                    else
                    {
                        type = extType.type;
                    }
                }
                if (type == null)
                {
                    type = o.GetType();
                }

                sbyte[] tag = PrototypeFactory.getClassHash(type);                 //cache this?
                out_Renamed.Write(SupportClass.ToByteArray(tag), 0, tag.Length);
            }
        }
Beispiel #2
0
        private void  InitBlock()
        {
            ExtUtil.writeNumeric(out_Renamed, attributes.size());

            for (TreeElement e: attributes)
            {
                ExtUtil.write(out_Renamed, e.getNamespace());
                ExtUtil.write(out_Renamed, e.getName());
                ExtUtil.write(out_Renamed, e.getAttributeValue());
            }
            int size = (int)ExtUtil.readNumeric(in_Renamed);

            List <TreeElement> attributes = new List <TreeElement>();

            for (int i = 0; i < size; ++i)
            {
                System.String namespace_Renamed = ExtUtil.readString(in_Renamed);
                System.String name          = ExtUtil.readString(in_Renamed);
                System.String value_Renamed = ExtUtil.readString(in_Renamed);

                TreeElement attr = TreeElement.constructAttributeElement(namespace_Renamed, name, value_Renamed);
                attr.setParent(parent);
                attributes.addElement(attr);
            }
            return(attributes);

            ExtUtil.stringCache = stringCache;
        }
Beispiel #3
0
        //functions like these are bad; they should use the built-in list serialization facilities
        //UPGRADE_TODO: Class 'java.io.DataOutputStream' was converted to 'System.IO.BinaryWriter' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javaioDataOutputStream'"
        public static void  writeInts(System.IO.BinaryWriter out_Renamed, int[] ints)
        {
            ExtUtil.writeNumeric(out_Renamed, ints.Length);

            for (int i: ints)
            {
                ExtUtil.writeNumeric(out_Renamed, i);
            }
        }
Beispiel #4
0
 //UPGRADE_TODO: Class 'java.io.DataOutputStream' was converted to 'System.IO.BinaryWriter' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javaioDataOutputStream'"
 public static void  writeBytes(System.IO.BinaryWriter out_Renamed, sbyte[] bytes)
 {
     ExtUtil.writeNumeric(out_Renamed, bytes.Length);
     if (bytes.Length > 0)
     {
         //i think writing zero-length array might close the stream
         out_Renamed.Write(SupportClass.ToByteArray(bytes));
     }
 }
Beispiel #5
0
        //UPGRADE_TODO: Class 'java.io.DataOutputStream' was converted to 'System.IO.BinaryWriter' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javaioDataOutputStream'"
        public override void writeExternal(System.IO.BinaryWriter out_Renamed)
        {
            System.Collections.ArrayList v = (System.Collections.ArrayList)val;

            ExtUtil.writeNumeric(out_Renamed, v.Count);
            for (int i = 0; i < v.Count; i++)
            {
                ExtUtil.write(out_Renamed, new ExtWrapTagged(v[i]));
            }
        }
Beispiel #6
0
        //UPGRADE_TODO: Class 'java.io.DataOutputStream' was converted to 'System.IO.BinaryWriter' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javaioDataOutputStream'"
        public override void writeExternal(System.IO.BinaryWriter out_Renamed)
        {
            System.Collections.ArrayList v = (System.Collections.ArrayList)val;

            ExtUtil.writeNumeric(out_Renamed, v.Count);
            for (int i = 0; i < v.Count; i++)
            {
                ExtUtil.write(out_Renamed, type == null ? v[i] : type.clone(v[i]));
            }
        }
Beispiel #7
0
        //UPGRADE_TODO: Class 'java.io.DataOutputStream' was converted to 'System.IO.BinaryWriter' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javaioDataOutputStream'"
        public override void  writeExternal(System.IO.BinaryWriter out_Renamed)
        {
            //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'"
            System.Collections.Hashtable h = (System.Collections.Hashtable)val;

            ExtUtil.writeNumeric(out_Renamed, h.Count);

            for (Object key: h.keySet())
            {
                //UPGRADE_TODO: Method 'java.util.HashMap.get' was converted to 'System.Collections.Hashtable.Item' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javautilHashMapget_javalangObject'"
                System.Object elem = h[key];

                ExtUtil.write(out_Renamed, keyType == null?key:keyType.clone(key));
                ExtUtil.write(out_Renamed, new ExtWrapTagged(elem));
            }
        }
Beispiel #8
0
        //UPGRADE_TODO: Class 'java.io.DataOutputStream' was converted to 'System.IO.BinaryWriter' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javaioDataOutputStream'"
        public override void metaWriteExternal(System.IO.BinaryWriter out_Renamed)
        {
            //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'"
            System.Collections.Hashtable h = (System.Collections.Hashtable)val;
            System.Object keyTagObj, elemTagObj;

            //UPGRADE_TODO: Method 'java.util.Iterator.next' was converted to 'System.Collections.IEnumerator.Current' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javautilIteratornext'"
            //UPGRADE_TODO: Method 'java.util.HashMap.keySet' was converted to 'SupportClass.HashSetSupport' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javautilHashMapkeySet'"
            keyTagObj = (keyType == null ? (h.Count == 0 ? new System.Object() : h.Keys.GetEnumerator().Current) : keyType);
            //UPGRADE_TODO: Method 'java.util.Iterator.next' was converted to 'System.Collections.IEnumerator.Current' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javautilIteratornext'"
            elemTagObj = (dataType == null ? (h.Count == 0 ? new System.Object() : h.Values.GetEnumerator().Current) : dataType);

            ExtUtil.writeNumeric(out_Renamed, type);
            ExtWrapTagged.writeTag(out_Renamed, keyTagObj);
            ExtWrapTagged.writeTag(out_Renamed, elemTagObj);
        }