RSS Forums RSS

I/O Binary stream

Please support our Java advertiser: Programming Forums
Reply
Posts: 2
Reputation: tte is an unknown quantity at this point 
Solved Threads: 0
tte tte is offline Offline
Newbie Poster

I/O Binary stream

  #1  
Nov 19th, 2008
Hi.

I've built a HttpServlet that catch a request and parse a web page using InputStream, InputStreamReader and PrintWriter changing some content along the way and output it as a response. Everything works like a charm (parsing html, css, gif, jpg, aso) except for png images.

Since png's are binary files (correct me if I'm wrong) my guess is i need to use something other than InputStream, InputStreamReader and PrintWriter to parse the png's. But what and how do I use it?

Thanks in advance.
AddThis Social Bookmark Button
Reply With Quote  
Posts: 27
Reputation: AlbertPi is an unknown quantity at this point 
Solved Threads: 2
AlbertPi AlbertPi is offline Offline
Light Poster

Re: I/O Binary stream

  #2  
Nov 20th, 2008
Originally Posted by tte View Post
Hi.

I've built a HttpServlet that catch a request and parse a web page using InputStream, InputStreamReader and PrintWriter changing some content along the way and output it as a response. Everything works like a charm (parsing html, css, gif, jpg, aso) except for png images.

Since png's are binary files (correct me if I'm wrong) my guess is i need to use something other than InputStream, InputStreamReader and PrintWriter to parse the png's. But what and how do I use it?

Thanks in advance.


Using ByteArrayInputStream to read a bindary file and then use InputStreamReader & BufferedReader. Also careful about "position". These will work.
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.



Views: 560 | Replies: 1 | Currently Viewing: 1 (0 members and 1 guests)

 

Thread Tools Display Modes
Forums | Blogs | Tutorials | Code Snippets | Whitepapers | RSS Feeds | Advertising
All times are GMT -4. The time now is 2:49 pm.
Newsletter Archive - Sitemap - Privacy Statement - Acceptable Use Policy - Contact Us
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC