IntBuffer clear() method in Java with Examples
The clear() method of java.nio.IntBuffer Class is used to clear this buffer. While clearing this buffer following changes are done:
- the position is set to zero
- the limit is set to the capacity
- the mark is discarded.
public final IntBuffer clear()
Parameter: The method do not take any parameter.
Return Value: This method returns this IntBuffer instance after clearing all the data from it.
Below are the examples to illustrate the clear() method:
position before reset: 4 position after reset: 0
position before clear: 3 position after clear: 0
My Personal Notes arrow_drop_up
Please Login to comment...