0

My input is "[B@ec3c95b"

String example ="[B@ec3c95b";

I want to make it same as output "[B@ec3c95b" in byte array type.

anson
  • 1,436
  • 14
  • 16
  • 3
    It sounds to me like someone's called `toString()` on a `byte[]` and assumed the result is useful - it's not. Please give more context, so we can help figure out what the root of the problem is. – Jon Skeet Mar 08 '17 at 17:40
  • 4
    Possible duplicate of [How to convert Java String into byte\[\]?](http://stackoverflow.com/questions/18571223/how-to-convert-java-string-into-byte) – Prajjwal Srivastav Mar 08 '17 at 17:41

1 Answers1

1

If I understand, you want to convert a String in a byte array.

For that, you can use the getBytes() function to convert your String :

String input = "[B@ec3c95b";
byte[] output = input.getBytes();
Jéwôm'
  • 3,753
  • 5
  • 40
  • 73