0

I want to convert a Byte array into a byte array, but I don't see any way to do so in java without using a loop.

Can someone please tell me a way to make it ?

1 Answers1

1

There is no need for that, because Java has an auto-unboxing system that automatically converts Bytes to bytes. So, you can use them the same way. But if you really have to, you have to use a loop.

nishantc1527
  • 376
  • 1
  • 12
  • 2
    There is a need if you have a `Byte[]` but need to call a method that expects a `byte[]`, since Java doesn't apply auto(un)boxing to entire arrays. – Andreas Aug 12 '19 at 00:48