In this tutorial, we will check this ByteBuffer is equal to another object or not.
ByteBuffer API:
The java.nio.ByteBuffer class extends java.nio.Buffer class. It provides the following methods:
| Return type | Method | Description |
| static ByteBuffer | allocate(int capacity) | The allocate(..)method allocate a new byte buffer. |
| boolean | equals(object obj) | The equals() method tells this buffer is equals or not to another object. |
| abstract ByteBuffer | putInt(int index, byte b) | The putInt(..) method write four byte containing the given int value into associated buffer. |
| abstract ByteBuffer | putChar(int index, byte b) | The putChar(..) method write 2 byte containing the given char value into associated buffer. |
import java.nio.*;
|
| C:\w>java ByteBufferEqual Equals Not equals Not equals |
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.