Exemple #1
0
  @Override
  @SuppressWarnings("unchecked")
  public void readFields(DataInput in) throws IOException {
    this.fst = null;
    this.snd = null;

    final ClassIndex index = new ClassIndex();
    index.readFields(in);

    int flags = in.readByte();

    try {
      if ((flags & FST_NULL) == NOT_NULL) {
        fst = (A) index.getClass(in.readByte()).newInstance();
        fst.readFields(in);
      }

      if ((flags & SND_NULL) == NOT_NULL) {
        snd = (B) index.getClass(in.readByte()).newInstance();
        snd.readFields(in);
      }
    } catch (Exception e) {
      throw new RuntimeException(e);
    }
  }