Byte[] to string, and then substring value, in Eclipse and EXE to obtain a different value

Source: Internet
Author: User

Convert byte[] buffer to string

String Messagecontent=new string (buffer,0,rlength). toString (). Trim ();

Use substring to take the eighth digit:

String fix1=messagecontent.substring (7,8);

This fix1 is a completely different value in the EXE program that Eclipse and exe4j pack. In this case, it may be that the data type stored in this byte[] is related,

The first eight bits of buffer are the numbers such as 0xFF, such as buffer[0]= (byte) 0xFF;

Byte[] to string, and then substring value, in Eclipse and EXE to obtain a different value

Related Article

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.