Results 1 to 2 of 2
Thread: bytearray to string conversion
- 01-28-2008, 08:33 AM #1
Member
- Join Date
- Nov 2007
- Posts
- 70
- Rep Power
- 0
bytearray to string conversion
I converted a String into a ByteArray. Then I tried to convert it back to string using toString() method. The output is not as expected. Please highlight the problem area:
Output:Java Code:String str = "Java World for 1.4"; byte bArray[] = new byte[str.length()]; bArray = str.getBytes(); String bString = bArray.toString(); System.out.println("Byte array converted to string: " + bString);
Java Code:Byte array converted to string: [B@3e25a5
- 01-28-2008, 10:39 AM #2
Similar Threads
-
Reading a File into ByteArray
By Java Tip in forum Java TipReplies: 0Last Post: 01-15-2008, 03:19 PM -
Method for String to int conversion
By Java Tip in forum Java TipReplies: 0Last Post: 01-02-2008, 06:35 PM -
String to Integer conversion
By eva in forum New To JavaReplies: 2Last Post: 12-17-2007, 03:59 PM -
Reading form inputStream and storing in ByteArray
By Java Tip in forum Java TipReplies: 0Last Post: 11-27-2007, 10:23 AM -
String to Date conversion
By javaplus in forum New To JavaReplies: 2Last Post: 11-06-2007, 07:16 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks