Buffer remaining() methods in Java with Examples
The remaining() method of java.nio.Buffer Class is used to return the number of elements between the current position and the limit.
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.
public final int remaining()
Return Value: This method returns the number of elements remaining in this buffer.
Below are the examples to illustrate the remaining() method:
Remaining element in buffer : 3
Remaining element in buffer : 1