M
mike
the followings is my code:
InputStream in = outSocket.getInputStream();
InputStreamReader insr = new InputStreamReader(in);
String myencode=insr.getEncoding();
int available_length=in.available();
int available_length_char=available_length/2;
char cbuf[] = new char[available_length_char];
System.out.println(available_length);
System.out.println(myencode);
insr.read(cbuf,0,available_length_char);
in.close();
insr.close();
i want to read the data in the InputStream and save the data in the cbuf array,
but by my code,i cannot read the complete HTML file,i print out the cbuf
and cannot see the HTML file end indicator:"</html>"
any suggestion is welcome thank you
InputStream in = outSocket.getInputStream();
InputStreamReader insr = new InputStreamReader(in);
String myencode=insr.getEncoding();
int available_length=in.available();
int available_length_char=available_length/2;
char cbuf[] = new char[available_length_char];
System.out.println(available_length);
System.out.println(myencode);
insr.read(cbuf,0,available_length_char);
in.close();
insr.close();
i want to read the data in the InputStream and save the data in the cbuf array,
but by my code,i cannot read the complete HTML file,i print out the cbuf
and cannot see the HTML file end indicator:"</html>"
any suggestion is welcome thank you