Need to help to convert string to hex bytes
<p>I am programming in Java.  The program have a String as below.</p>

<pre><code>String str = "byte."
</code></pre>

<p>Can the above string be converted to an array of hex bytes as below?</p>

<pre><code>byte[] data = {0x62, 0x79, 0x74, 0x65};
</code></pre>

<p>Thank you.</p>
