Shortcuts

Tools

String2hex

/**
 * Convert string to hexadecimal
 * @param str String to convert
 * @return hex array
 */
DataUtil.string2hex("Hello")

Bytes2string

/**
 * The byte array is converted into a string according to the required encoding format
 * @param bytes byte array to convert
 * @param charsetName Required encoding format
 * @return Converted string
 */
SerialPortTools.bytes2string(bytes, "GBK")

String2bytes

/**
 * The string is converted into a byte array according to the required encoding format
 * @param string String to convert
 * @param charsetName Required encoding format
 * @return Converted byte array
 */
SerialPortTools.bytes2string("Hello", "GBK")
Read the Docs v: latest
Versions
latest
stable
4.1.9
Downloads
pdf
html
epub
On Read the Docs
Project Home
Builds

Free document hosting provided by Read the Docs.