@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()));
   }
 }
 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);
     }
   }
 }
 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();
   }
 }
Пример #4
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);
   }
 }
  /** {@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);
    }
  }
  /** {@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();
  }
Пример #7
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());
   }
 }
Пример #8
0
 protected void readHeader(ObjectInput in) throws IOException, ClassNotFoundException {
   byte[] b = new byte[in.readShort()];
   in.readFully(b);
   setHeader(b);
 }