Socket inputstream read failure
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Michael_Tang
Posted On:   Tuesday, December 2, 2008 04:33 AM

why the last bit of reading of input stream need to wait for one or minutes to end, which results in the client socket timeout, is there any approach to read the input stream data?

See the code below


String request = null;
ByteArrayOutputStream bis = new ByteArrayOutputStream();
while ((count = in.read(bytes)) >= 0) {
System.out.println("count = " + count);
bis.write(bytes, 0, count);

}
in.close();

About | Sitemap | Contact