/** {@inheritDoc} */
  public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {

    // VERSION
    int version = in.readByte();

    // SUPER
    super.readExternal(in);

    // NUMBER OF ENTRIES
    int size = in.readInt();

    if (version >= 1) {
      // LOAD FACTOR
      _loadFactor = in.readFloat();

      // NO ENTRY VALUE
      no_entry_value = in.readShort();
      //noinspection RedundantCast
      if (no_entry_value != (short) 0) {
        Arrays.fill(_set, no_entry_value);
      }
    }

    // ENTRIES
    setUp(size);
    while (size-- > 0) {
      short val = in.readShort();
      add(val);
    }
  }
示例#2
0
  /** @see BTmsg#readExternal(java.io.ObjectInput) */
  @SuppressWarnings("unchecked")
  @Override
  public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
    super.readExternal(in);

    // Read the number of assignments and the assignment to the first variable
    // so that we can instantiate the array of assignments
    this.offset = in.readShort();
    this.nbrAssignments = in.readShort();
    V val = (V) in.readObject();
    this.assignments =
        (V[][]) Array.newInstance(Array.newInstance(val.getClass(), 0).getClass(), nbrAssignments);
    final boolean externalize = val.externalize();

    // Read the assignments one by one
    for (int i = this.offset; i < this.nbrAssignments; i++) {
      short nbrVars = in.readShort();
      V[] assignment = (V[]) Array.newInstance(val.getClass(), nbrVars);
      this.assignments[i] = assignment;
      for (int j = nbrVars - 1; j >= 0; j--) {
        if (externalize) {
          val = val.getZero();
          val.readExternal(in);
          assignment[j] = (V) val.readResolve();
        } else assignment[j] = (V) in.readObject();
      }
    }

    this.cost = (U) in.readObject();
  }
 @Override
 public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
   // little endian
   this.cardinality = 0xFFFF & Short.reverseBytes(in.readShort());
   if (this.content.limit() < this.cardinality)
     this.content = ShortBuffer.allocate(this.cardinality);
   for (int k = 0; k < this.cardinality; ++k) {
     this.content.put(k, Short.reverseBytes(in.readShort()));
   }
 }
示例#4
0
 /**
  * Read this in
  *
  * @exception IOException error reading from log stream
  * @exception ClassNotFoundException corrupted log stream
  */
 public synchronized void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
   setPrevblk(in.readLong());
   setNextblk(in.readLong());
   setBytesused(in.readShort());
   setBytesinuse(in.readShort());
   setPageLSN(in.readLong());
   in.read(data);
   // if (in.read(data) != datasize) {
   //	throw new IOException(
   //		"Datablock read size invalid " + this.toString());
   // }
 }
示例#5
0
 @Override
 public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
   super.readExternal(in);
   eventType = in.readShort();
   streamId = in.readInt();
   bufferLength = in.readInt();
 }
示例#6
0
  @Override
  public void readExternal(final ObjectInput in) throws IOException, ClassNotFoundException {
    final byte version = in.readByte(); // future use

    final ClientMetaData client = new ClientMetaData();
    final EJBMetaDataImpl ejb = new EJBMetaDataImpl();
    final ServerMetaData server = new ServerMetaData();

    client.setMetaData(metaData);
    client.readExternal(in);

    ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
    if (classLoader == null) {
      classLoader = this.getClass().getClassLoader();
    }

    ejb.homeClass = loadClass(classLoader, (String) in.readObject());
    ejb.remoteClass = loadClass(classLoader, (String) in.readObject());
    ejb.keyClass = loadClass(classLoader, (String) in.readObject());
    ejb.type = in.readByte();
    ejb.deploymentID = in.readUTF();
    ejb.deploymentCode = in.readShort();

    server.setMetaData(metaData);
    server.readExternal(in);

    handler = EJBHomeHandler.createEJBHomeHandler(ejb, server, client, null);
    ejbHomeProxy = handler.createEJBHomeProxy();
  }
 static void readSlotWithFields(
     short fieldsKey[], ClassMetaDataSlot slot, ObjectInput input, Object obj)
     throws IOException, ClassNotFoundException {
   short numberOfFields = (short) fieldsKey.length;
   for (short i = 0; i < numberOfFields; i++) {
     ClassMetadataField field = slot.getFields()[fieldsKey[i]];
     if (field.getField().getType() == Integer.TYPE) {
       FieldsManager.getFieldsManager().setInt(obj, field, input.readInt());
     } else if (field.getField().getType() == Byte.TYPE) {
       FieldsManager.getFieldsManager().setByte(obj, field, input.readByte());
     } else if (field.getField().getType() == Long.TYPE) {
       FieldsManager.getFieldsManager().setLong(obj, field, input.readLong());
     } else if (field.getField().getType() == Float.TYPE) {
       FieldsManager.getFieldsManager().setFloat(obj, field, input.readFloat());
     } else if (field.getField().getType() == Double.TYPE) {
       FieldsManager.getFieldsManager().setDouble(obj, field, input.readDouble());
     } else if (field.getField().getType() == Short.TYPE) {
       FieldsManager.getFieldsManager().setShort(obj, field, input.readShort());
     } else if (field.getField().getType() == Character.TYPE) {
       FieldsManager.getFieldsManager().setCharacter(obj, field, input.readChar());
     } else if (field.getField().getType() == Boolean.TYPE) {
       FieldsManager.getFieldsManager().setBoolean(obj, field, input.readBoolean());
     } else {
       Object objTmp = input.readObject();
       FieldsManager.getFieldsManager().setObject(obj, field, objTmp);
     }
   }
 }
示例#8
0
  /** @see java.io.Externalizable#readExternal(java.io.ObjectInput) */
  @SuppressWarnings("unchecked")
  public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
    this.sender = (String) in.readObject();
    this.receiver = (String) in.readObject();

    // Read the context
    short nbrVars = in.readShort();
    this.context = new HashMap<String, Val>(nbrVars);
    if (nbrVars > 0) {
      // Read the info about the first variable
      String var = (String) in.readObject();
      Val val = (Val) in.readObject();
      this.context.put(var, val);
      final boolean externalize = val.externalize();

      // Read the remaining variables
      for (short i = 1; i < nbrVars; i++) {
        var = (String) in.readObject();
        if (externalize) {
          val = val.getZero();
          val.readExternal(in);
          val = (Val) val.readResolve();
        } else val = (Val) in.readObject();
        this.context.put(var, val);
      }
    }

    // Read the bounds
    this.lb = (U) in.readObject();
    if (this.lb.externalize()) {
      this.ub = this.lb.getZero();
      this.ub.readExternal(in);
      this.ub = (U) this.ub.readResolve();
    } else this.ub = (U) in.readObject();
  }
 public void readExternal(final ObjectInput in) throws IOException, ClassNotFoundException {
   in.readByte();
   this._pos = in.readInt();
   final int len = in.readInt();
   this._data = new short[len];
   for (int i = 0; i < len; ++i) {
     this._data[i] = in.readShort();
   }
 }
  @Override
  public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {

    // VERSION
    in.readByte();

    // POSITION
    _pos = in.readInt();

    // NO_ENTRY_VALUE
    no_entry_value = in.readShort();

    // ENTRIES
    int len = in.readInt();
    _data = new TShortOffheapArray(len);
    for (int i = 0; i < len; i++) {
      _data.put(i, in.readShort());
    }
  }
  public void readExternal(ObjectInput objectinput) throws IOException, ClassNotFoundException {
    int j = objectinput.readInt();
    short aword0[] = new short[j];
    for (int i = 0; i < j; i++) {
      aword0[i] = objectinput.readShort();
    }

    data = aword0;
    size = j;
  }
 /**
  * Stores a value which is read from the provided {@code objectInput} to the provided byte {@code
  * buffer} at the specified {@code index}.
  *
  * @param objectInput the object input stream from which the value is read
  * @param wordSize the number of bytes used to store the value read from the stream
  * @param outputBuffer the byte buffer to which the value is stored
  * @param index the index where the value is stored in the buffer
  * @throws IOException if an error occurred reading from the object input stream
  */
 private static void readExternalWord(
     ObjectInput objectInput, int wordSize, ByteBuffer outputBuffer, int index)
     throws IOException {
   int wordIndex = index * wordSize;
   if (wordSize == SHORT_NUM_BYTES) {
     outputBuffer.putShort(wordIndex, objectInput.readShort());
   } else {
     outputBuffer.putInt(wordIndex, objectInput.readInt());
   }
 }
示例#13
0
 protected void readPackager(ObjectInput in) throws IOException, ClassNotFoundException {
   byte[] b = new byte[in.readShort()];
   in.readFully(b);
   try {
     Class mypClass = Class.forName(new String(b));
     ISOPackager myp = (ISOPackager) mypClass.newInstance();
     setPackager(myp);
   } catch (Exception e) {
     setPackager(null);
   }
 }
示例#14
0
  public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
    in.readByte();

    super.readExternal(in);

    int size = in.readInt();
    setUp(size);
    while (size-- > 0) {
      char key = in.readChar();
      short val = in.readShort();
      put(key, val);
    }
  }
  /** {@inheritDoc} */
  public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
    // VERSION
    in.readByte();

    // SUPER
    super.readExternal(in);

    // NUMBER OF ENTRIES
    int size = in.readInt();
    setUp(size);

    // ENTRIES
    while (size-- > 0) {
      byte key = in.readByte();
      short val = in.readShort();
      put(key, val);
    }
  }
 /**
  * For Externalizable
  *
  * @see Externalizable
  */
 public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
   int identityLength = in.readShort();
   if (identityLength > BYTES_32KB) {
     throw new IOException(
         LocalizedStrings.ClientProxyMembershipID_HANDSHAKE_IDENTITY_LENGTH_IS_TOO_BIG
             .toLocalizedString());
   }
   this.identity = new byte[identityLength];
   read(in, this.identity);
   this.uniqueId = in.readInt();
   if (this.uniqueId == -1) {
     throw new IOException(
         LocalizedStrings
             .ClientProxyMembershipID_UNEXPECTED_EOF_REACHED_UNIQUE_ID_COULD_NOT_BE_READ
             .toLocalizedString());
   }
   //    {toString(); this.transientPort = ((InternalDistributedMember)this.memberId).getPort();}
 }
 public static List<OrganizationalEntity> readOrganizationalEntityList(ObjectInput in)
     throws IOException, ClassNotFoundException {
   int size = in.readInt();
   List<OrganizationalEntity> list = new ArrayList<OrganizationalEntity>(size);
   for (int i = 0; i < size; i++) {
     short type = in.readShort();
     if (type == 0) {
       User user = new User();
       user.readExternal(in);
       list.add(user);
     } else {
       Group group = new Group();
       group.readExternal(in);
       list.add(group);
     }
   }
   return list;
 }
  /** {@inheritDoc} */
  @Override
  public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
    nodeId = GridUtils.readUuid(in);

    ver = CU.readVersion(in);

    timeout = in.readLong();
    threadId = in.readLong();
    id = in.readLong();

    short flags = in.readShort();

    mask(OWNER, OWNER.get(flags));
    mask(USED, USED.get(flags));
    mask(TX, TX.get(flags));

    ts = U.currentTimeMillis();
  }
示例#19
0
 public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
   in.readByte(); // ignore version for now
   fieldNumber = in.readShort();
   byte fieldType;
   ISOComponent c;
   try {
     while ((fieldType = in.readByte()) != 'E') {
       c = null;
       switch (fieldType) {
         case 'F':
           c = new ISOField();
           break;
         case 'A':
           c = new ISOAmount();
           break;
         case 'B':
           c = new ISOBinaryField();
           break;
         case 'M':
           c = new ISOMsg();
           break;
         case 'H':
           readHeader(in);
           break;
         case 'P':
           readPackager(in);
           break;
         case 'D':
           readDirection(in);
           break;
         default:
           throw new IOException("malformed ISOMsg");
       }
       if (c != null) {
         ((Externalizable) c).readExternal(in);
         set(c);
       }
     }
   } catch (ISOException e) {
     throw new IOException(e.getMessage());
   }
 }
示例#20
0
  /**
   * Note: The de-serialized state contains {@link Value}s but not {@link BigdataValue}s since the
   * {@link AbstractTripleStore} reference is not available and we can not obtain the appropriate
   * {@link BigdataValueFactory} instance without it. This should not matter since the only access
   * to the {@link Value}s is via {@link #get(Value)} and {@link #getConstant(Value)}.
   */
  public void readExternal(final ObjectInput in) throws IOException, ClassNotFoundException {

    if (val2iv != null) throw new IllegalStateException();
    if (iv2val != null) throw new IllegalStateException();

    final short version = in.readShort();

    switch (version) {
        //        case VERSION0:
        //            readVersion0(in);
        //            break;
        //        case VERSION1:
        //            readVersion1(in);
        //            break;
      case VERSION2:
        readVersion2(in);
        break;
      default:
        throw new UnsupportedOperationException("Unknown version: " + version);
    }
  }
示例#21
0
 public void readExternal(final ObjectInput in) throws IOException, ClassNotFoundException {
   for (int i = 0; i < _calls.length; i++) {
     _calls[i] = in.readShort();
   }
 }
  @Override
  public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
    this.characterid = in.readInt();
    this.accountid = in.readInt();
    this.accountname = in.readUTF();
    this.channel = in.readByte();
    this.ACash = in.readInt();
    this.MaplePoints = in.readInt();
    this.name = in.readUTF();
    this.fame = in.readInt();
    this.love = in.readInt();
    this.gender = in.readByte();
    this.level = in.readShort();
    this.str = in.readShort();
    this.dex = in.readShort();
    this.int_ = in.readShort();
    this.luk = in.readShort();
    this.hp = in.readInt();
    this.mp = in.readInt();
    this.maxhp = in.readInt();
    this.maxmp = in.readInt();
    this.exp = in.readLong();
    this.hpApUsed = in.readShort();
    this.remainingAp = in.readShort();
    this.remainingSp = in.readShort();
    this.meso = in.readInt();
    this.skinColor = in.readByte();
    this.job = in.readShort();
    this.hair = in.readInt();
    this.face = in.readInt();
    this.mapid = in.readInt();
    this.initialSpawnPoint = in.readByte();
    this.world = in.readByte();
    this.guildid = in.readInt();
    this.guildrank = in.readByte();
    this.guildContribution = in.readInt();
    this.alliancerank = in.readByte();
    this.sidekick = in.readInt();
    this.gmLevel = in.readByte();
    this.points = in.readInt();
    this.vpoints = in.readInt();

    if (in.readByte() == 1) {
      this.BlessOfFairy = in.readUTF();
    } else {
      this.BlessOfFairy = null;
    }
    if (in.readByte() == 1) {
      this.BlessOfEmpress = in.readUTF();
    } else {
      this.BlessOfEmpress = null;
    }
    if (in.readByte() == 1) {
      this.chalkboard = in.readUTF();
    } else {
      this.chalkboard = null;
    }
    this.skillmacro = in.readObject();
    this.lastfametime = in.readLong();
    this.storage = in.readObject();
    this.pvpStats = in.readObject();
    this.potionPot = in.readObject();
    this.coreAura = in.readObject();
    this.cs = in.readObject();
    this.battlers = in.readObject();
    this.mount_itemid = in.readInt();
    this.mount_Fatigue = in.readByte();
    this.mount_level = in.readByte();
    this.mount_exp = in.readInt();
    this.partyid = in.readInt();
    this.messengerid = in.readInt();
    this.inventorys = in.readObject();
    this.fairyExp = in.readByte();
    this.subcategory = in.readByte();
    this.fatigue = in.readShort();
    this.marriageId = in.readInt();
    this.familyid = in.readInt();
    this.seniorid = in.readInt();
    this.junior1 = in.readInt();
    this.junior2 = in.readInt();
    this.currentrep = in.readInt();
    this.totalrep = in.readInt();
    this.gachexp = in.readInt();
    this.totalWins = in.readInt();
    this.totalLosses = in.readInt();
    this.anticheat = in.readObject();
    this.tempIP = in.readUTF();
    this.pvpExp = in.readInt();
    this.pvpPoints = in.readInt();
    this.antiMacro = in.readObject();
    this.decorate = in.readInt();
    this.beans = in.readInt();
    this.warning = in.readInt();
    this.dollars = in.readInt();
    this.shareLots = in.readInt();
    this.apstorage = in.readInt();
    this.honor = in.readInt();
    this.cardStack = in.readInt();
    this.morphCount = in.readInt();
    this.powerCount = in.readInt();
    this.playerPoints = in.readInt();
    this.playerEnergy = in.readInt();
    this.pvpDeaths = in.readInt();
    this.pvpKills = in.readInt();
    this.pvpVictory = in.readInt();
    this.runningDark = in.readInt();
    this.runningDarkSlot = in.readInt();
    this.runningLight = in.readInt();
    this.runningLightSlot = in.readInt();
    int mbooksize = in.readShort();
    for (int i = 0; i < mbooksize; i++) {
      this.mbook.put(in.readInt(), in.readInt());
    }
    int skillsize = in.readShort();
    for (int i = 0; i < skillsize; i++) {
      this.Skills.put(
          in.readInt(),
          new SkillEntry(in.readInt(), in.readByte(), in.readLong(), in.readInt(), in.readByte()));
    }
    this.buddysize = in.readByte();
    short addedbuddysize = in.readShort();
    for (int i = 0; i < addedbuddysize; i++) {
      this.buddies.put(
          new CharacterNameAndId(in.readInt(), in.readUTF(), in.readUTF()), in.readBoolean());
    }
    int questsize = in.readShort();
    for (int i = 0; i < questsize; i++) {
      this.Quest.put(in.readInt(), in.readObject());
    }
    int rzsize = in.readByte();
    for (int i = 0; i < rzsize; i++) {
      this.reports.put(in.readByte(), in.readInt());
    }
    int achievesize = in.readByte();
    for (int i = 0; i < achievesize; i++) {
      this.finishedAchievements.add(in.readInt());
    }
    int famesize = in.readByte();
    for (int i = 0; i < famesize; i++) {
      this.famedcharacters.add(in.readInt());
    }
    int battlesize = in.readInt();
    for (int i = 0; i < battlesize; i++) {
      this.battledaccs.add(in.readInt());
    }
    int savesize = in.readByte();
    this.savedlocation = new int[savesize];
    for (int i = 0; i < savesize; i++) {
      this.savedlocation[i] = in.readInt();
    }
    int wsize = in.readByte();
    this.wishlist = new int[wsize];
    for (int i = 0; i < wsize; i++) {
      this.wishlist[i] = in.readInt();
    }
    int rsize = in.readByte();
    this.rocks = new int[rsize];
    for (int i = 0; i < rsize; i++) {
      this.rocks[i] = in.readInt();
    }
    int resize = in.readByte();
    this.regrocks = new int[resize];
    for (int i = 0; i < resize; i++) {
      this.regrocks[i] = in.readInt();
    }
    int hesize = in.readByte();
    this.hyperrocks = new int[resize];
    for (int i = 0; i < hesize; i++) {
      this.hyperrocks[i] = in.readInt();
    }
    int KeyValueSize = in.readShort();
    for (int i = 0; i < KeyValueSize; i++) {
      this.KeyValue.put(in.readUTF(), in.readUTF());
    }
    int infosize = in.readShort();
    for (int i = 0; i < infosize; i++) {
      this.InfoQuest.put(in.readInt(), in.readUTF());
    }
    int keysize = in.readInt();
    for (int i = 0; i < keysize; i++) {
      this.keymap.put(in.readInt(), new Pair(in.readByte(), in.readInt()));
    }
    int qssize = in.readInt();
    for (int i = 0; i < qssize; i++) {
      this.quickslot.add(new Pair(in.readInt(), in.readInt()));
    }
    int fsize = in.readShort();
    for (int i = 0; i < fsize; i++) {
      this.familiars.put(
          in.readInt(),
          new MonsterFamiliar(
              this.characterid,
              in.readInt(),
              in.readInt(),
              in.readLong(),
              in.readUTF(),
              in.readInt(),
              in.readByte()));
    }
    this.petStore = in.readByte();
    int boxedsize = in.readShort();
    for (int i = 0; i < boxedsize; i++) {
      this.boxed.add(in.readObject());
    }
    int rebsize = in.readShort();
    for (int i = 0; i < rebsize; i++) {
      this.rebuy.add((MapleShopItem) in.readObject());
    }
    this.imps = new MapleImp[in.readByte()];
    for (int x = 0; x < this.imps.length; x++) {
      if (in.readByte() > 0) {
        MapleImp i = new MapleImp(in.readInt());
        i.setFullness(in.readShort());
        i.setCloseness(in.readShort());
        i.setState(in.readByte());
        i.setLevel(in.readByte());
        this.imps[x] = i;
      }
    }
    this.lastLoveTime = in.readLong();
    int lovesize = in.readByte();
    for (int i = 0; i < lovesize; i++) {
      this.loveCharacters.put(in.readInt(), in.readLong());
    }
    this.TranferTime = System.currentTimeMillis();
  }
示例#23
0
 protected void readHeader(ObjectInput in) throws IOException, ClassNotFoundException {
   byte[] b = new byte[in.readShort()];
   in.readFully(b);
   setHeader(b);
 }
 @Override
 protected Object readObject(ObjectInput in) throws IOException {
   return Short.valueOf(in.readShort());
 }