This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes I/O and Streams and the fly likes BufferedOutputStream not working for image and *.exe files Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » I/O and Streams
Bookmark "BufferedOutputStream not working for image and *.exe files" Watch "BufferedOutputStream not working for image and *.exe files" New topic
Author

BufferedOutputStream not working for image and *.exe files

saravanan palanivel
Greenhorn

Joined: Sep 05, 2012
Posts: 9
Hi,
I am using BufferedOutputStream for file upload and download in windows. It works fine for writing files to targeted folder with same size, but the problem is *.exe files and image files like *.png,*.jpg are not opening. What method I should use to overcome this issue..
please help me ...
Kemal Sokolovic
Bartender

Joined: Jun 19, 2010
Posts: 825
    
    5

Check ImageWriter and ImageOutputStream from API, for saving images.


The quieter you are, the more you are able to hear.
saravanan palanivel
Greenhorn

Joined: Sep 05, 2012
Posts: 9
Hi Kemal,
Will it work for *.txt,*.pdf,*.xls,and *.sitx and other file format?
please..
Kemal Sokolovic
Bartender

Joined: Jun 19, 2010
Posts: 825
    
    5

saravanan palanivel wrote:Hi Kemal,
Will it work for *.txt,*.pdf,*.xls,and *.sitx and other file format?
please..


No, these are for images.
To write to txt you can use FileWriter + BufferedWriter. I think that for pdf and xls you'll need to find some third party libraries that support writing in these formats.
saravanan palanivel
Greenhorn

Joined: Sep 05, 2012
Posts: 9
Kemal,
Thank you very much for your quick response..!
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: BufferedOutputStream not working for image and *.exe files
 
Similar Threads
SQL Server image datatype
Can Applet thorugh RMI invoke files on remote m/c?How??
Copying a Binary (EXE) file
how to decrease the size of the jpeg image file?
Tomcat: Starting It Up