I am developing a web-proxy server, which intercepts requests from the
browser, contacts the remote server and relays the response back to
the browser.However I have some problem with the way images are getting
displayed.Some images dont get displayed at all while others may be
half loaaded only.There is no problem with getting the text in the page
Just have a look at my code below and point out the potential problem :

RemoteUrl = new URL( url_string.trim() ) ;
ClientIn = new BufferedInputStream( RemoteUrl.openStream()) ;
outstream = new BufferedOutputStream( ClientSocket.getOutputStream() ) ;

byte[] buf = new byte[1024];
int len = 0;

while ((len = ClientIn.read(buf)) >= 0)