ObjectInputStream available() method in Java with examples
The available() method of the ObjectInputStream class in Java returns the number of bytes that can be read without blocking the stream.
public int available()
Parameters: This method does not accept any parameter.
Return Value: This method returns the number of available bytes.
Below program illustrate the above method:
Attention reader! Don’t stop learning now. Get hold of all the important Java Foundation and Collections concepts with the Fundamentals of Java and Java Collections Course at a student-friendly price and become industry ready. To complete your preparation from learning a language to DS Algo and many more, please refer Complete Interview Preparation Course.