public static LineByLineFileInputOperator checkpoint(LineByLineFileInputOperator oper,ByteArrayOutputStream bos) throws Exception {
  Kryo kryo=new Kryo();
  Output loutput=new Output(bos);
  kryo.writeObject(loutput,oper);
  loutput.close();
  Input lInput=new Input(bos.toByteArray());
  @SuppressWarnings("unchecked") LineByLineFileInputOperator checkPointedOper=kryo.readObject(lInput,oper.getClass());
  lInput.close();
  return checkPointedOper;
}

public static LineByLineFileInputOperator checkpoint ( LineByLineFileInputOperator oper , ByteArrayOutputStream bos ) throws Exception { Kryo kryo = new Kryo ( ) ; Output loutput = new Output ( bos ) ; kryo . writeObject ( loutput , oper ) ; loutput . close ( ) ; Input lInput = new Input ( bos . toByteArray ( ) ) ; @ SuppressWarnings ( "unchecked" ) LineByLineFileInputOperator checkPointedOper = kryo . readObject ( lInput , oper . getClass ( ) ) ; lInput . close ( ) ; return checkPointedOper ; }
this method checkpoints the given operator .
