Snippets tagged “getbytes”
1 snippet uses this tag.
- How to convert Java String into byte[]?Java
To convert a Java string into a byte array, you can use the getBytes() method of the java.lang.String class. This method returns an array of bytes representing the string in a specific encoding.