Code example for ObjectOutputStream

Methods: close, writeObject

0
                log.debug("Serialization file is created at "+filePath);
            } else{ 
                log.debug("Serialization file is already existing at "+filePath);
            } 
             
            ObjOut = new ObjectOutputStream(new FileOutputStream(outFile));
            ObjOut.writeObject(serializableObj);
 
        } catch (IOException e) {
            log.error("Failed to serialize the object "+serializableObj.toString()
                      + " to file "+filePath , e);
            throw e;
             
        } finally{ 
            ObjOut.close();
        } 
 
    } 
     
    /** 
     * Serialize a {@link FasterLookUpDataHolder} to a byte array.