In this tutorial you will see the use of equals() method of ByteBuffer class in java.
In this tutorial you will see the use of equals() method of ByteBuffer class in java.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 |