ReadI16() public abstract method

public abstract ReadI16 ( ) : short
return short
        private static object ReadDataObject(Serializer serializer, Type type, Message message)
        {
            if(!typeof(IObservableDataObject).IsAssignableFrom(type))
                return Activator.CreateInstance(type);

            IDataObjectFactory dataObjectFactory;
            int dataObjectId;

            var referenceRemoteId = serializer.ReadI32();
            var isPolymorphic = serializer.ReadBool();
            if (isPolymorphic)
            {
                var contextId = serializer.ReadI16();
                dataObjectId = serializer.ReadI16();
                dataObjectFactory = message.RemotingManager.ContextManager.GetDataObjectFactory(contextId);
            }
            else
            {
                dataObjectId = type.GetCustomAttribute<DataObjectAttribute>().Id;
                var contextId = message.RemotingManager.ContextManager.GetContextId(type.Assembly);
                dataObjectFactory = message.RemotingManager.ContextManager.GetDataObjectFactory(contextId);
            }

            var dataObject = dataObjectFactory.CreateDataObjectReference((ushort) dataObjectId, message.Peer, referenceRemoteId, message.RemotingManager.ReferenceManager);
            dataObject.Read(serializer, null, message);

            return dataObject;
        }