I want to know if an InputStream is empty, but without using the method read(). Is there a way to know if it\'s empty without reading from it?
InputStream
read()
How about using inputStreamReader.ready() to find out?
import java.io.InputStreamReader; /// ... InputStreamReader reader = new InputStreamReader(inputStream); if (reader.ready()) { // do something } // ...