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 1057767
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T17:55:14+00:00 2026-05-16T17:55:14+00:00

I have a byte array represented by hex values, these are time durations. The

  • 0

I have a byte array represented by hex values, these are time durations. The data could be converted to integer values and multiplied by a constant to get the timings. The decoding of the data will be saved to a file as a series of hex strings. What would be an efficient way of manipulating hex values?


I was looking at performance issues when dealing with data formats, as I have to work with more than one format at different stages (calculations, data display, etc.). Most examples show the conversion from byte[] to hex string (“1A 3C D4”), and viceversa, but I was looking for an alternative, which is to convert to Int16 and use char[] array.

  • 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-05-16T17:55:14+00:00Added an answer on May 16, 2026 at 5:55 pm

    You don’t have a byte array representing hex values. You have a byte array representing numbers. The base you represent a number in is only relevant when you’re representing it.

    To put it a different way: if you thought of your byte array as representing decimal integers instead, how do you imagine it would be different? Is my height different if I represent it in feet and inches instead of metres?

    Now, if you’re trying to represent 16-bit numbers, I’d suggest that using a byte array is a bad idea. Use a ushort[] or short[] instead, as those are 16-bit values. If you’re having trouble getting the data into an array like that, please give details… likewise if you have any other problems with the manipulation. Just be aware that until you’re writing the data out as text, there’s really no such concept as which base it’s in, as far as the computer is concerned.

    (Note that this is different for floating point values, where the data really would be different between a decimal and a double, for example… there, the base of representation is part of the data format. It’s not for integers. Alternatively, you can think of all integers as just being binary until you decide to format them as text…)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a byte array filled with hex numbers and printing it the easy
I have to create BYTE* array that will store some text and binary data
So I have a gigantic byte-array that represents a data packet. There's various parts
Say we have a struct that it's data is provided by un-managed byte array
I currently have the following array in a Java program, byte[] data = new
I have a an array of byte, size n, that really represents an array
I have a byte array which needs to be marshalled into the following struct:
I have a byte array and I need to convert this to a image.
I have a byte array, received from java application via network. I need to
I have a byte array highlighted below, how do I insert it into a

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.