Suppose I have a byte array with 65 indices, and I want to fill the first 62 indices (or bytes) with data since index 63-65 are reserved. How can I move a byte array to the first 62 indices of the byte array?
String message = "Hello to the client. This is the message that you will receive"; //62 bytes message
byte[] b = message.getBytes();
byte[] sendData = new byte[65];
//how can I transfer byte[] b to 0-62?
getBytesdepends on an encoding. Can you be sure that 62 bytes will always be enough?String.getBytes.