Use Buffered Reader instead of DataInputStream.
I think it will work
If not tell me too
Bye
>From: kaab kaoutar <[EMAIL PROTECTED]> >Reply-To: A mailing list about Java Server Pages specification and reference <[EMAIL PROTECTED]> >To: [EMAIL PROTECTED] >Subject: urlconnection & readfully fails >Date: Fri, 1 Jun 2001 12:29:48 -0000 > >Hi! > >can u please help ? >i use this code to get a url page using readfully! > >URL urlObject = new URL(url); > URLConnection agent = urlObject.openConnection(); > DataInputStream input = > new DataInputStream(agent.getInputStream()); > > byte[] b = new byte[input.available >()];System.out.println(input.available()); > input.readFully (b); > input.close ();System.out.println(b.length); > page=new String (b, 0, b.length); >but it gives me only some piece of the page > >but when i read line by line that way: > while((nextLine = input.readLine()) != null) { > page.append(nextLine+"\n"); > } >it works! > >please help > >_________________________________________________________________________ >Get Your Private, Free E-mail from MSN Hotmail at >http://www.hotmail.com. > >=========================================================================== >To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff >JSP-INTEREST". >For digest: mailto [EMAIL PROTECTED] with body: "set >JSP-INTEREST DIGEST". >Some relevant FAQs on JSP/Servlets can be found at: > >http://java.sun.com/products/jsp/faq.html >http://www.esperanto.org.nz/jsp/jspfaq.html >http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP >http://www.jguru.com/jguru/faq/faqpage.jsp?name=ServletsGet Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
=========================================================================== To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST". For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST". Some relevant FAQs on JSP/Servlets can be found at: http://java.sun.com/products/jsp/faq.html http://www.esperanto.org.nz/jsp/jspfaq.html http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets