Why convert back and forth? just leave it as a byte[] array.
Or if you need to change it, convert it to something like ArrayList<Byte>
sivaprasad pasupulathi
Ranch Hand
Joined: Apr 21, 2009
Posts: 36
posted
0
Thanks Farrell for your response.
I need to convert byte[] to string,because I have to send my response as String to my webservice call.So,i have to convert my byte[] to string before sending across the web-service .I am converting back to byte[] because i want to make sure I deliver what i am passing to client.(testing)
Then I hate to say that solution is only half-good. Never use classes in packages that start with sun, sunw or com.sun - these are internal classes that are undocumented and can change or be removed between any two releases.
There is a similar class in Apache Commons Codec: Base64. Use the static encodeBase64String and decodeBase64 for converting.