0

I have a string which represents an application (converted in bytes and then encoded in base64 -- if you ask yourself why, it is because i am transferring an application from a server to the client, in the hope of rebuilding it when transferred).

How would I get a Byte array back from this string?

1
  • string.getBytes() ? Commented Nov 29, 2017 at 18:40

1 Answer 1

3

String class has what you need (in java, a String is a class)

   "this is a string".getBytes();

also take a look at this for base64 decoding of the String

org.apache.commons.codec.binary.Base64

java from 8 and beyond also has a base64 class built-in

java.util.Base64
Sign up to request clarification or add additional context in comments.

1 Comment

Don't forget about charset. In any OS u can get different results

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.