简体   繁体   中英

split string in Java without delimiter, do math, then recombine

I have one very long string of numbers, and I need to convert it into binary. However, sometimes it can be so long that my system (Android phone) cannot handle it even as a Long.

So I need to break up the string in half, do the binary conversion on each individual half, then recombine both halves as the output string.

My problem is pretty much as described here by Ted Hopp: Translating a String containing a binary value to Hex

I need some clues on how I'd go about this . . .

Have you considered using a standard Java BigInteger?

http://developer.android.com/reference/java/math/BigInteger.html

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM