SyntaxFix
Write A Post
Hire A Developer
Questions
The Apache Commons Codec library has a Hex class for doing just this type of work.
import org.apache.commons.codec.binary.Hex; String foo = "I am a string"; byte[] bytes = foo.getBytes(); System.out.println( Hex.encodeHexString( bytes ) );