ShortBuffer clear() methods in Java with Examples
The clear() method of java.nio.ShortBuffer Class is used to clear this buffer. While clearing this buffer following changes are done:
- the current position is set to zero
- the limit of this ShortBuffer instance is set to the capacity
- the mark, if any, of this ShortBuffer instance is discarded.
public final ShortBuffer clear()
Return Value: This method returns this ShortBuffer 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...