public static void serializeObjectToFile(File targetFile, Serializable serializable) {
        FileOutputStream fileOutputStream = null;
        ObjectOutputStream objectOutputStream = null;
        try {
            fileOutputStream = new FileOutputStream(targetFile);
            try {
                objectOutputStream = new ObjectOutputStream(fileOutputStream);
                objectOutputStream.writeObject(serializable);
            } catch (IOException e) {
                LOGGER.error(e);
            }
        } catch (FileNotFoundException e) {
            LOGGER.error(e);
        } finally {
            closeOutStream(objectOutputStream);
            closeOutStream(fileOutputStream);
        }
    }
public static void serializeObjectToFile(File targetFile, Serializable serializable) {
        FileOutputStream fileOutputStream = null;
        ObjectOutputStream objectOutputStream = null;
        try {
            fileOutputStream = new FileOutputStream(targetFile);
            try {
                objectOutputStream = new ObjectOutputStream(fileOutputStream);
                objectOutputStream.writeObject(serializable);
            } catch (IOException e) {
                LOGGER.error(e);
            }
        } catch (FileNotFoundException e) {
            LOGGER.error(e);
        } finally {
            closeOutStream(objectOutputStream);
            closeOutStream(fileOutputStream);
        }
    }
public static void serializeObjectToFile ( File targetFile , Serializable serializable ) { FileOutputStream fileOutputStream = null ; ObjectOutputStream objectOutputStream = null ; try { fileOutputStream = new FileOutputStream ( targetFile ) ; try { objectOutputStream = new ObjectOutputStream ( fileOutputStream ) ; objectOutputStream . writeObject ( serializable ) ; } catch ( IOException e ) { LOGGER . error ( e ) ; } } catch ( FileNotFoundException e ) { LOGGER . error ( e ) ; } finally { closeOutStream ( objectOutputStream ) ; closeOutStream ( fileOutputStream ) ; } }
将对象写入文件 <br>
2013-9-6 下午1:08:58

@param targetFile
@param serializable
将对象写入文件 <br > 2013 - 9 - 6 下午1 : 08 : 58