public void serializeFormDef(FormDef fd,String filepath){
  String hash=FileUtils.getMd5Hash(new File(filepath));
  File formDef=new File(Collect.CACHE_PATH + File.separator + hash+ ".formdef");
  if (!formDef.exists()) {
    FileOutputStream fos;
    try {
      fos=new FileOutputStream(formDef);
      DataOutputStream dos=new DataOutputStream(fos);
      fd.writeExternal(dos);
      dos.flush();
      dos.close();
    }
 catch (    FileNotFoundException e) {
      e.printStackTrace();
    }
catch (    IOException e) {
      e.printStackTrace();
    }
  }
}

public void serializeFormDef ( FormDef fd , String filepath ) { String hash = FileUtils . getMd5Hash ( new File ( filepath ) ) ; File formDef = new File ( Collect . CACHE_PATH + File . separator + hash + ".formdef" ) ; if ( ! formDef . exists ( ) ) { FileOutputStream fos ; try { fos = new FileOutputStream ( formDef ) ; DataOutputStream dos = new DataOutputStream ( fos ) ; fd . writeExternal ( dos ) ; dos . flush ( ) ; dos . close ( ) ; } catch ( FileNotFoundException e ) { e . printStackTrace ( ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } } }
write the formdef to the file system as a binary blog .
