We help IT Professionals succeed at work.

Check out our new AWS podcast with Certified Expert, Phil Phillips! Listen to "How to Execute a Seamless AWS Migration" on EE or on your favorite podcast platform. Listen Now

x

Converting a 4 bytes long to a java 8 bytes long...

simlox
simlox asked
on
Medium Priority
366 Views
Last Modified: 2010-05-18
I am reading a file that contains longs as 4 bytes, chars as 1 byte, ints as 2 bytes values..
I need to convert all the values to java native types.. (long as 8 byte, int as 4 byte and
char as 2 bytes)....

how can this be done...

can some code be included...
Comment
Watch Question

Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION

Commented:
Did this solve your problem?

Author

Commented:
Yes.. it worked perfectly..

Commented:
Then why did you give it a "D"? I'm curious. You must have expected more. I thought that the supplied code was sufficient an answer. Obviously I was mistaken.

Author

Commented:
I gave it a 'B'.... The other question on conversions
from a binary file using ObjectInputStream was given a
'D'..not this one.. I use the above information on the
same binary file..

Commented:
My mistake, I confused the questions. I'm still disappointed that you graded the other question a "D" .. It is kind of a matter of pride. Yours is the only D I've gotten thus far as an "expert" here. Oh, well...
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.