Java wireshark 16 binary copy of a string conversion byte array

Source: Internet
Author: User

String a= " 880a4336fd85a87ef39cfaa8c072d8899578d9c4c409ea78161edd41b52f96f377bf162a1bfd4be8e90022354a983d3c426bf34439719c89407ca7064 49171413dd6e08cb9792ba8965227e6df8e182d1821f67758b7309bc7d6dce1593c07fbb0c85e50c0ef3c04a4acf9ed09f7126b96b7fc1dbbe45fc367 24e87d8bc28ad265c540053967a58d60e4ec34cd1efda2537ccefc1225629a64f4f1876f0c7471f783576884d86d2faa3f4975f3399c8e0357d49ad07 Ca4320fb8151867e698e3849bf4d971020b7d76c1e84bb58358c5 ";
Byte[] bytes=new byte[a.length ()/2];
for (int i=0;i<a.length ()/2;i++)
{
String temp=a.substring (i*2, (i+1) * *);
System.out.println ("string:" +temp);
Byte v = (byte) integer.parseint (temp, 16);
Bytes[i]=v;
}
String Decode=test.decode (str.getbytes (), bytes);

Java wireshark 16 binary copy of a string conversion byte array

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.