public override Object ReadMap(AbstractHessianInput abstractHessianInput)
    {
        String value = null;

        while (!abstractHessianInput.IsEnd())
        {
            String key = abstractHessianInput.ReadString();

            if (key.Equals("value"))
            {
                value = abstractHessianInput.ReadString();
            }
            else
            {
                abstractHessianInput.ReadObject();
            }
        }

        abstractHessianInput.ReadMapEnd();

        Object obj = Create(value);

        abstractHessianInput.AddRef(obj);

        return(obj);
    }
    public override Object ReadObject(AbstractHessianInput abstractHessianInput, Object[] fields)
    {
        String[] fieldNames = (String[])fields;

        String value = null;

        for (int i = 0; i < fieldNames.Length; i++)
        {
            if ("value".Equals(fieldNames[i]))
            {
                value = abstractHessianInput.ReadString();
            }
            else
            {
                abstractHessianInput.ReadObject();
            }
        }

        object obj = Create(value);

        abstractHessianInput.AddRef(obj);

        return(obj);
    }
        //JAVA TO VB & C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
        //ORIGINAL LINE: public Object readLengthList(AbstractHessianInput in, int length) throws IOException
        public override object ReadLengthList(AbstractHessianInput @in, int length)
        {
            IList list = createList();

            @in.AddRef(list);

            for (; length > 0; length--)
            {
              list.Add(@in.ReadObject());
            }

            return list;
        }
        public override object ReadMap(AbstractHessianInput abstractHessianInput)
        {
            Hashtable fieldValueMap = new Hashtable();
            string _message = null;
            Exception _innerException = null;
            while (! abstractHessianInput.IsEnd())
            {
                object objKey = abstractHessianInput.ReadObject();
                if(objKey != null)
                {
                    IDictionary deserFields = GetDeserializableFields();
                    FieldInfo field = (FieldInfo) deserFields[objKey];
                    // try to convert a Java Exception in a .NET exception
                    if(objKey.ToString() == "_message" || objKey.ToString() == "detailMessage")
                    {
                        if (field != null)
                            _message = abstractHessianInput.ReadObject(field.FieldType) as string;
                        else
                            _message = abstractHessianInput.ReadObject().ToString();
                    }
                    else if(objKey.ToString() == "_innerException" || objKey.ToString() == "cause")
                    {
                        try
                        {
                            if (field != null)
                                _innerException = abstractHessianInput.ReadObject(field.FieldType) as Exception;
                            else
                                _innerException = abstractHessianInput.ReadObject(typeof(Exception)) as Exception;
                        }
                        catch (Exception e)
                        {
                            // als Cause ist bei Java gerne mal eine zirkuläre Referenz auf die Exception selbst
                            // angegeben. Das klappt nicht, weil die Referenz noch nicht registriert ist,
                            // weil der Typ noch nicht klar ist (s.u.)
                        }
                    }
                    else
                    {
                        if (field != null)
                        {
                            object objFieldValue = abstractHessianInput.ReadObject(field.FieldType);
                            fieldValueMap.Add(field, objFieldValue);
                        } else
                            // ignore (z. B. Exception Stacktrace "stackTrace" von Java)
                            abstractHessianInput.ReadObject();
                        //field.SetValue(result, objFieldValue);
                    }
                }

            }
            abstractHessianInput.ReadEnd();

            object result =  null;
            try
            {
            #if COMPACT_FRAMEWORK
                //CF TODO: tbd
            #else
                try
                {
                    result = Activator.CreateInstance(this.m_type, new object[2]{_message, _innerException});
                }
                catch(Exception)
                {
                    try
                    {
                        result = Activator.CreateInstance(this.m_type, new object[1]{_innerException});
                    }
                    catch(Exception)
                    {
                        try
                        {
                            result = Activator.CreateInstance(this.m_type, new object[1]{_message});
                        }
                        catch(Exception)
                        {
                            result = Activator.CreateInstance(this.m_type);
                        }
                    }
                }
            #endif

            }
            catch(Exception)
            {
                result = new Exception(_message, _innerException);
            }
            foreach (DictionaryEntry entry in fieldValueMap)
            {
                FieldInfo fieldInfo = (FieldInfo) entry.Key;
                object value = entry.Value;
                try {fieldInfo.SetValue(result, value);} catch(Exception){}
            }

            // besser spät als gar nicht.
            int refer = abstractHessianInput.AddRef(result);

            return result;
        }
        //JAVA TO VB & C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
        //ORIGINAL LINE: public Object readList(AbstractHessianInput in, int length) throws IOException
        public override object ReadList(AbstractHessianInput @in, int length)
        {
            IList list = createList();

            @in.AddRef(list);

            while (! @in.IsEnd())
            {
              list.Add(@in.ReadObject());
            }

            @in.ReadEnd();

            return list;
        }