Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Converting byteArray in UTF-16 format to String or character.  RSS feed

 
kumar mahesh
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I invoke a webservice which returns the data in a byte array but in UTF-16 format with every character stored in two consecutive bytes. Thus the first character in the data would be stored in arr[0] and arr[1], with the more significant byte stored in arr[1]. I need to convert this byte Array into a String.

For Ex:
byte[] arr = //invoke the web method.

Kindly reply.

Regards,
mahesh
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!