How do I check if InputStream is empty?

How do I check if InputStream is empty?
Answer
No, you can’t. InputStream is designed to work with remote resources, so you can’t know if it’s there until you actually read from it. You may be able to use a
java.
…
  1. available() tells you if there’s data ready to be read, it doesn’t necessarily tell you if the stream is empty. …
  2. @skaffman: thanks a lot!
 

Tìm kiếm

Back
Top