Ejemplo n.º 1
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: protected void writeClassDescriptor(java.io.ObjectStreamClass desc) throws java.io.IOException
        protected internal override void WriteClassDescriptor(ObjectStreamClass desc)
        {
            if (_versionMapper.hasMappingFor(desc.Name))
            {
                UpdateWirePayloadSuid(desc);
            }

            base.WriteClassDescriptor(desc);
        }
Ejemplo n.º 2
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: protected java.io.ObjectStreamClass readClassDescriptor() throws java.io.IOException, ClassNotFoundException
        protected internal override ObjectStreamClass ReadClassDescriptor()
        {
            ObjectStreamClass wireClassDescriptor = base.ReadClassDescriptor();

            if (!_versionMapper.hasMappingFor(wireClassDescriptor.Name))
            {
                _versionMapper.addMappingFor(wireClassDescriptor.Name, wireClassDescriptor.SerialVersionUID);
            }

            Type localClass;               // the class in the local JVM that this descriptor represents.

            try
            {
                localClass = Type.GetType(wireClassDescriptor.Name);
            }
            catch (ClassNotFoundException)
            {
                return(wireClassDescriptor);
            }
            ObjectStreamClass localClassDescriptor = ObjectStreamClass.lookup(localClass);

            if (localClassDescriptor != null)
            {
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final long localSUID = localClassDescriptor.getSerialVersionUID();
                long localSUID = localClassDescriptor.SerialVersionUID;
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final long wireSUID = wireClassDescriptor.getSerialVersionUID();
                long wireSUID = wireClassDescriptor.SerialVersionUID;
                if (wireSUID != localSUID)
                {
                    wireClassDescriptor = localClassDescriptor;
                }
            }
            return(wireClassDescriptor);
        }