Answer the question
In order to leave comments, you need to log in
Answer the question
In order to leave comments, you need to log in
int[] data = { 100, 200, 300, 400 };
ByteBuffer byteBuffer = ByteBuffer.allocate(data.length * 4);
IntBuffer intBuffer = byteBuffer.asIntBuffer();
intBuffer.put(data);
byte[] array = byteBuffer.array();
And what prevents you from allocating an array of bytes and writing values there in a loop?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question