@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); } }
@Override public void readFields(DataInput dataInput) throws IOException { first.readFields(dataInput); // System.err.println("read key: " + first); second.readFields(dataInput); // System.err.println("read value: " + second); }