【问题标题】:How can I convert from hexadecimal string to normal string?如何从十六进制字符串转换为普通字符串?
【发布时间】:2015-07-28 23:44:27
【问题描述】:

我收到 HTTP GET 响应作为十六进制字符串数据与 java 中的套接字。但我想将普通字符串转换为 HTML 格式的数据。我怎样才能做到?

【问题讨论】:

  • 你用谷歌搜索了吗?
  • 是的,当然。但我不想任何库文件。它使用 apache 库。我想也许还有其他方法。

标签: java android hex converter


【解决方案1】:
byte[] bytes = Hex.decodeHex(YourhexString .toCharArray());
String s=new String(bytes, "UTF-8");

【讨论】:

  • 谢谢艾哈迈德·阿尔萨尼。没有图书馆有什么办法吗?
猜你喜欢
  • 2013-12-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2013-02-07
  • 1970-01-01
  • 2016-01-01
  • 2010-10-18
相关资源
最近更新 更多