@Test public void testSerializeObjectToFile() throws Exception { }
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); } }
FileHelper { 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); } } }
FileHelper { 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); } }  }
FileHelper { 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); } }  static boolean checkFileSizeLessThen(File file, long size); static File appendStringToFile(File file, String string); static File appendBytesToFile(File file, byte[] bts); static String getMimeType(File data); static File[] listFilesBySuffix(File folder, final String suffix); static File readBufferImage(BufferedImage bufferedImage); static File readURL(String urlStr); static String readInputStreamToString(InputStream inputStream, Charset charset); static String readInputStreamToString(InputStream inputStream, String encoding); static InputStream openStream(File file); static Reader openReader(File file); static BufferedReader openBufferedReader(File file); static String readInputStreamToString(InputStream inputStream); static File readInputStream(InputStream inputStream); static URL toURL(File file); static File readInputStream(InputStream inputStream, File file); static File readInputStream(InputStream inputStream, String path); static String readFileToString(String fileName); static String readFileToString(File file); static String getEncode(File file); static File validateFile(File file); static void copyFile(String originFilePath, String targetFilePath); static void copyFile(URL originURL, File targetFile); static void copyFile(InputStream inputStream, File targetFile); static void copyFile(File originFile, File targetFile); static boolean cutFile(File originFile, File targetFile); static void fileNotFullAndExists(File file); static byte[] readInputStreamToBytes(InputStream inputStream); static ByteBuffer growByteBuffer(ByteBuffer byteBuffer, int size); static byte[] readFileToBytes(File iconFile); static File writeBytesToFile(byte[] data, File file); static File writeStringToFile(File file, String string); static void serializeObjectToFile(File targetFile, Serializable serializable); static void closeInputStream(InputStream inputStream); static void closeOutStream(OutputStream outputStream); static Object unSerializeObjectFromFile(File targetFile); static void main(String[] args); static void closeReader(Reader reader); static void closeWriter(Writer writer); static void flushAndCloseWriter(Writer writer); static boolean initFile(File file); }
FileHelper { 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); } }  static boolean checkFileSizeLessThen(File file, long size); static File appendStringToFile(File file, String string); static File appendBytesToFile(File file, byte[] bts); static String getMimeType(File data); static File[] listFilesBySuffix(File folder, final String suffix); static File readBufferImage(BufferedImage bufferedImage); static File readURL(String urlStr); static String readInputStreamToString(InputStream inputStream, Charset charset); static String readInputStreamToString(InputStream inputStream, String encoding); static InputStream openStream(File file); static Reader openReader(File file); static BufferedReader openBufferedReader(File file); static String readInputStreamToString(InputStream inputStream); static File readInputStream(InputStream inputStream); static URL toURL(File file); static File readInputStream(InputStream inputStream, File file); static File readInputStream(InputStream inputStream, String path); static String readFileToString(String fileName); static String readFileToString(File file); static String getEncode(File file); static File validateFile(File file); static void copyFile(String originFilePath, String targetFilePath); static void copyFile(URL originURL, File targetFile); static void copyFile(InputStream inputStream, File targetFile); static void copyFile(File originFile, File targetFile); static boolean cutFile(File originFile, File targetFile); static void fileNotFullAndExists(File file); static byte[] readInputStreamToBytes(InputStream inputStream); static ByteBuffer growByteBuffer(ByteBuffer byteBuffer, int size); static byte[] readFileToBytes(File iconFile); static File writeBytesToFile(byte[] data, File file); static File writeStringToFile(File file, String string); static void serializeObjectToFile(File targetFile, Serializable serializable); static void closeInputStream(InputStream inputStream); static void closeOutStream(OutputStream outputStream); static Object unSerializeObjectFromFile(File targetFile); static void main(String[] args); static void closeReader(Reader reader); static void closeWriter(Writer writer); static void flushAndCloseWriter(Writer writer); static boolean initFile(File file); static final Logger LOGGER; static final long KB; static final long MB; static final long GB; static final long TB; static final long PB; }