In this tutorial, we will discuss how to clean a short buffer by using clear method.
The java.nio.ShortBuffer class extends java.nio.Buffer class. It provides the following methods:
|static ShortBuffer||allocate( int capacity)||The allocate(..) method allocate a short buffer of given capacity.|
|abstract ShortBuffer||put(short s)||The put(..)method write a given short value at current position.|
The java.nio.Buffer class extends java.lang.Object class. It provides the following methods:
|final Buffer||clear()||The clear() method clear the buffer.|
|Int||remaining()||The remaining() method returns remaining element in buffer.|
| C:\>java ClearShortBuff
Short data in a short buffer.
Number of remaining elements in short buffer : 0
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.