Skip navigation
Currently Being Moderated

How to convert ByteArray to String?

Jul 10, 2012 6:36 AM

Hi All!

 

I have a query. I have an application which gives me font file as byte array. I want to convert that byte array data to a string value. I used the ByteArray.toString(). To confirm that a valid string value has been computed, I converted the string to byte array once again. But, the new byte array differs from the original one. How can I go about this..?

 

To rephrase my question, I want to convert a byte array containing ttf font file data to a string. How?

 

Please guide..

Thanks!

 
Replies
  • Currently Being Moderated
    Jul 11, 2012 1:22 AM   in reply to poortip87

    Hi,

     

    There is method  readUTFBytes(); in bytearray class you can use this for reading bytearray as string if you want to convert string to bytearray u can use method called writeUTFbytes();

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points