Last active
August 29, 2015 14:06
-
-
Save SpiritOfDarkDragon/eff8288e4e91d1132fb7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Convert from String to byte[]: | |
String s = "some text here"; | |
byte[] b = s.getBytes("US-ASCII"); | |
//Convert from byte[] to String: | |
byte[] b = {(byte) 99, (byte)97, (byte)116}; | |
String s = new String(b, "UTF-8"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment