Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8784407
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T21:04:58+00:00 2026-06-13T21:04:58+00:00

I want to convert String to bytearray in java.. For Example i want output

  • 0

I want to convert String to bytearray in java..

For Example i want output like the following :

String s = "82,73,70,70,90,95,3,0,87,65,86";

Now the logic is , i want same String value in bytearray value like

byte[] b ={82,73,70,70,90,95,3,0,87,65,86};

b = s.getBytes(); doesn’t return the same value…it returns each string of byte array value

Any help would be appreciated lot

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T21:04:59+00:00Added an answer on June 13, 2026 at 9:04 pm

    So you can try to split your String with , and then in loop parse each number with static method Byte.parseByte(<el>);

    String source = "1,2,3,4,5";
    String[] temp = source.split(","); // this split your String with ,
    byte[] bytesArray = new byte[temp.lenght];
    int index = 0;
    for (String item: temp) {
       bytesArray[index] = Byte.parseByte(item);
       index++;
    }
    

    Also have look at

    • Convert string to byte[]
    • Byte order mark
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Basically, what I want is to convert a string like 123456 to unsigned byte
I have string like this 0100110011001 I want to convert it to byte array
I want to convert String to Date in different formats. For example, I am
I want to convert a string like 2012-03-08T00:00:00+01:00 into Date.. I tried to use
I have a hexadecimal value, 07A5953EE7592CE8871EE287F9C0A5FBC2BB43695589D95E76A4A9D37019C8 Which I want to convert to a byte
Hi I want to convert the NSString into Byte array. if I have string
I want to convert a String to binary by putting it in a byte
I want to convert a string to formatted text in C# in WPF application,
I want to convert a string '30/12/2012' to '2012/12/30'. My application is set to
i want to convert this string into DateTime. Tue Aug 19 15:05:05 +0000 2008

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.