Is it possible?
I am trying to conver a string to a 4byte array.
I saw a way of doing so with integer:
int i =55555;
ByteBuffer.allocate(4).putInt(i).array();
Cant find a way with String.
Is it possible?
I am trying to conver a string to a 4byte array.
I saw a way of doing so with integer:
int i =55555;
ByteBuffer.allocate(4).putInt(i).array();
Cant find a way with String.
Whats wrong with "5555".getBytes();
or if you only want the first 4 bytes
"5555555".substring(0, 4).getBytes();