The java.util.InputStream.available is a method in Java that returns an estimate of the number of bytes that can be read from the input stream without blocking. This method can be used to determine the amount of data available to be read from the stream before calling the read() method, which reads the data from the stream into a byte array. The available method is useful for optimizing the reading process, as it allows the programmer to allocate the appropriate size of the byte array for reading the stream data efficiently. However, it should be noted that the return value of available is only an estimate, and the actual number of bytes that can be read without blocking may be less than the value returned.
Java InputStream.available - 18 examples found. These are the top rated real world Java examples of java.util.InputStream.available extracted from open source projects. You can rate examples to help us improve the quality of examples.