RE: InputStream vs. getText

Alex <[email protected]>
Newsgroups gmane.comp.web.httpunit.devel
Message-ID <[email protected]>
This is an output if I use InputStream to print source code from html. It
stops in the middle of source code..even though I use until   !=null

------------------------------

InputStreamReader inR = new InputStreamReader( body ); 

BufferedReader buf = new BufferedReader( inR ); 

String line; 

   while ( ( line = buf.readLine() ) != null ) 

  System.out.println(line);        

 

 

//as InputStream  prints output and stops here

function submitForms(asConfirmation, asAlert) {

 

BUILD SUCCESSFUL (total time: 3 seconds)

-----------------------------------------

 

//as getText  works fine and prints ALL output

WebRequest request = new GetMethodWebRequest(muURL);

WebResponse response = wc.getResponse( request );

System.out.println(response.getText());

 

..//part of output

function submitForms(asConfirmation, asAlert) {

 

    if (checkFormData() == false)

        return false;

 

    var sEmptyFields = '';

 

 

    if (document.frmCorp.FNAME.value == '' ||
isEmptyString(document.frmCorp.FNAME.value) != false) {

    sEmptyFields += (sEmptyFields == '' ? '' : ', ') +
document.frmCorp.FNAMELabel.value;

}

..

 

  _____  

From: [email protected]
[mailto:[email protected]] On Behalf Of Russell
Gold
Sent: Monday, April 10, 2006 7:30 AM
To: [email protected]
Subject: Re: [Httpunit-develop] InputStream vs. getText

 

 

On Apr 10, 2006, at 4:06 AM, Alex wrote:





I am reading source code of URL. If I read it using InputStream not
everything goes to the output, on the other hand if I use
System.out.println(response.getText()); it's working fine and prints out
whole output of the source code. See below

In all probability, the data contains some odd characters. Note that the
getText() function does not use the algorithm you are.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.