Save as swf file using httpconnection and file io

I have one application which is fatch the swf file from web and i want to save as in same to swf file format.

when i have fatch the swf file and save as .swf format i have unable to view as flash animation in browser and micromedia.

Anyone suggest me ?

#############################################################

URL url = new URL("http://nileshpatel.com/abc.swf");

HttpURLConnection con = (HttpURLConnection) url.openConnection();

con.setRequestProperty( "User-Agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)" );

BufferedReader rd;

rd = new BufferedReader(new InputStreamReader(con.getInputStream()));

String line="";

String content="";

File f = new File("users/nileshpatel/neo.swf");

FileWriter fw = new FileWriter(f);

while ((line = rd.readLine()) != null) {

content += line;

}

rd.close();

fw.write(content);

fw.close();

############################################################

[1025 byte] By [Neon_Andersona] at [2007-10-2 18:10:22]
# 1
Use a FileOutputStream to write binary data.
BIJ001a at 2007-7-13 19:30:07 > top of Java-index,Developer Tools,Debugging and Profiling Tool APIs...
# 2
Use no (character.oriented) readers, writers, but (byte-oriented) streams.
BIJ001a at 2007-7-13 19:30:07 > top of Java-index,Developer Tools,Debugging and Profiling Tool APIs...
# 3
Hi Ivan Jozsef Balazs ,thanks for your suggestion i will try for it and update you soon.Bye
Neon_Andersona at 2007-7-13 19:30:07 > top of Java-index,Developer Tools,Debugging and Profiling Tool APIs...
# 4

BTW sometimes flash uses communication with server to obtain some information before/during running. In such case you'll need to provide kind of your own HTTP server, pass swf to browser using HTTP protocol (not directly from HDD) then pass all additional data.

Hope this is not your case :)

Michael.Nazarov@sun.coma at 2007-7-13 19:30:07 > top of Java-index,Developer Tools,Debugging and Profiling Tool APIs...
# 5
yes you are right but this is not in my case Now my application running fine in using fileinputStream
Neon_Andersona at 2007-7-13 19:30:07 > top of Java-index,Developer Tools,Debugging and Profiling Tool APIs...