class HopRowCoder extends AtomicCoder<HopRow> {

  @Override public HopRow decode( InputStream inStream ) throws CoderException, IOException {

    ObjectInputStream in = new ObjectInputStream( inStream );

    Object[] row = null;
    int length = in.readInt();
    if ( length < 0 ) {
      return new HopRow( row );
    }
    row = new Object[ length ];
    for ( int i = 0; i < length; i++ ) {
      // Null?
      boolean isNull = in.readBoolean();
      if ( !isNull ) {
        int objectType = in.readInt();
        Object object = read( in, objectType );
        row[ i ] = object;
      }
    }

    return new HopRow( row );
  }

}