Mutual conversion method between Java binary data and hexadecimal string
•
Java
The general input formats of binary data are 0x45, 0x3a and 0xc3. This data format looks like a hexadecimal string, but actually each corresponds to a byte when stored. For example, the binary byte of 0x45 is 0100 0101, and the corresponding hexadecimal string is 0x45. In the actual programming process, we often encounter the mutual transformation of these two formats. Record the code here.
Convert binary data into hexadecimal string (add ':' and ';' in the middle to view the subscript, or remove it by yourself):
Convert hexadecimal string to binary data:
The above conversion method between Java binary data and hexadecimal string is all the content shared by Xiaobian. I hope it can give you a reference and support programming tips.
The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
二维码