Results 1 to 6 of 6
Thread: converting binary to string
- 03-27-2011, 03:09 PM #1
Member
- Join Date
- Feb 2011
- Posts
- 28
- Rep Power
- 0
- 03-27-2011, 03:13 PM #2
Member
- Join Date
- Feb 2011
- Posts
- 28
- Rep Power
- 0
fyi, i have declared an array as boolean..
i have converted the text into binary and put it in the register,
i want to do the reverse now
so how i'm gonna deal with it?
- 03-27-2011, 03:27 PM #3
Senior Member
- Join Date
- Nov 2010
- Location
- Delhi
- Posts
- 135
- Blog Entries
- 1
- Rep Power
- 0
You should do SSCCE (Short, Self Contained, Correct Example) for this.
Lets see what you have done so far
- 03-27-2011, 04:12 PM #4
Member
- Join Date
- Feb 2011
- Posts
- 28
- Rep Power
- 0
i have used this code above to convert text to binaryXML Code:byte[] bytes = key.getBytes(); StringBuilder binary = new StringBuilder(); for (byte b : bytes) { int val = b; for (int i = 0; i < 8; i++) { binary.append((val & 128) == 0 ? 0 : 1); val <<= 1; } }
can u tell me how to reverse it back?
i have tried using toString() method but it only print 'true' or 'false'
hmm... so how?
- 03-27-2011, 07:11 PM #5
Double posted at
conversion text-binary-text
The discussion should continue here.
db
- 03-27-2011, 07:20 PM #6
Member
- Join Date
- Feb 2011
- Posts
- 28
- Rep Power
- 0
Similar Threads
-
Converting characters to decimal to binary
By Majeh in forum New To JavaReplies: 4Last Post: 02-04-2011, 11:06 PM -
Algorithm for converting binary/hex to decimal
By addictz04 in forum New To JavaReplies: 2Last Post: 11-29-2010, 06:49 PM -
converting to binary
By telltera in forum New To JavaReplies: 5Last Post: 09-02-2010, 02:35 PM -
Funny glitch while converting from int to 32 bit binary.....
By sarshad in forum New To JavaReplies: 2Last Post: 07-09-2010, 12:37 PM -
Converting mp3 files to binary
By kylefrank in forum Advanced JavaReplies: 4Last Post: 06-09-2010, 08:25 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks