public static void writeObjectToFile ( File file , Object object ) throws IOException { FileOutputStream fs = new FileOutputStream ( file ) ; ObjectOutputStream os = new ObjectOutputStream ( fs ) ; os . writeObject ( object ) ; os . close ( ) ; }
Writes a single object to a file .