• Post Reply Bookmark Topic Watch Topic
  • New Topic

bufferedinputstream help

 
michael yue
Ranch Hand
Posts: 204
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying to get some data using bufferedinputstream and my code is as below. The thing is it gets stuck at the read line without returning any exception. Also the filesize that got printed is 0. Does this means that the server is not returning anything or there is some other explanation? Using bufferedreader with readline also gets stuck at the read line.

The data i am suppose to get is like an xml file. thanks

 
Joe Ess
Bartender
Posts: 9362
11
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you look at the documentation for BufferedInputStream, you will see that a call to read() will block until:

# The specified number of bytes have been read,
# The read method of the underlying stream returns -1, indicating end-of-file, or
# The available method of the underlying stream returns zero, indicating that further input requests would block.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!