public static OIdentifiable readIdentifiable(final OChannelBinaryClient network) throws IOException {
    final int classId = network.readShort();
    if (classId == RECORD_NULL)
      return null;

    if (classId == RECORD_RID) {
      return network.readRID();
    } else {
      final ORecordInternal<?> record = Orient.instance().getRecordFactoryManager().newInstance(network.readByte());

      if (record instanceof ORecordSchemaAware<?>)
        ((ORecordSchemaAware<?>) record).fill(network.readRID(), network.readInt(), network.readBytes(), false);
      else
        // DISCARD CLASS ID
        record.fill(network.readRID(), network.readInt(), network.readBytes(), false);

      return record;
    }
  }
public static OIdentifiable readIdentifiable ( final OChannelBinaryClient network ) throws IOException { final int classId = network . readShort ( ) ; if ( classId == RECORD_NULL ) return null ; if ( classId == RECORD_RID ) { return network . readRID ( ) ; } else { final ORecordInternal < ? > record = Orient . instance ( ) . getRecordFactoryManager ( ) . newInstance ( network . readByte ( ) ) ; if ( record instanceof ORecordSchemaAware < ? > ) ( ( ORecordSchemaAware < ? > ) record ) . fill ( network . readRID ( ) , network . readInt ( ) , network . readBytes ( ) , false ) ; else record . fill ( network . readRID ( ) , network . readInt ( ) , network . readBytes ( ) , false ) ; return record ; } }
SENT AS SHORT AS FIRST PACKET AFTER SOCKET CONNECTION