aspose file tools
The moose likes Java in General and the fly likes Converting long integer to byte Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Java in General
Reply locked New topic
Author

Converting long integer to byte

Koot Jart
Greenhorn

Joined: Sep 25, 2008
Posts: 25
Hi!

I'm making a small application for J2ME. I need to convert long integer to byte table. Those long integers can very long like this: 3460215174411169804

How can I read this long to this kind of byte-table:

byte table[] = new byte[8];

I would like to see some examples.

Remember, I'm using J2ME, so I don't have all the classes in use, what can be use in J2SE.
Bauke Scholtz
Ranch Hand

Joined: Oct 08, 2006
Posts: 2458
Doublepost: http://www.coderanch.com/t/426556/Java-General-intermediate/How-to-read-long-to

Don´t doublepost. Please stick to one topic. If you have new questions regarding to the given answers, post them in the originating topic instead of repeating the topic.


Code depot of a Java EE / JSF developer | JSF / Eclipse / Tomcat kickoff tutorial | DAO kickoff tutorial | I ♥ Unicode
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Converting long integer to byte
 
Similar Threads
Compile error when I try to use float, works if I change it to double..
How to read "long" in to byte table
Not operator
regarding forward referencing and 'implicit narrowing conversion'
writing 4 byte little-endian long integers