×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: Java
Posted by: sumesh tg
Added: Nov 7, 2016 10:21 AM
Views: 4
Tags: task usage
  1.         Task taskSerialize = new Task() {
  2.             @Override
  3.             protected Object call() throws Exception {
  4.                 List<EnquiryDetailsSearchPOJO> enquiryList = EnquiryDetailsDAO.patternSearchEnquiryDetails("");
  5.                 try {
  6.                     FileOutputStream fileOut
  7.                             = new FileOutputStream("Enquiry_details.ser");
  8.                     ObjectOutputStream out = new ObjectOutputStream(fileOut);
  9.                     out.writeObject(enquiryList);
  10.  
  11.                     out.close();
  12.                     fileOut.close();
  13.                 } catch (IOException i) {
  14.                     i.printStackTrace();
  15.                 }
  16.                 return null;
  17.             }
  18.         };
  19.         new Thread(taskSerialize).start();