java - Porting NSString to NSData to Android -


we're porting 1 of projects objective-c java.

byte data coming server encoded string, , we're converting byte array.

[objective-c]:

nsstring * imagestring = @"abcde......"; //quite long string nsdata * imagedata = [imagestring datausingencoding:nsunicodestringencoding]; constant byte * imagebytes = [imagedata bytes];  

now, i'm trying same on android

[java]:

string imagestring = "abcde......"; //quite long string byte [] imagebytes = imagestring.getdata("utf-16"); 

however, if compare imagebytes arrays first , second snippets, different. presume has utf-16 encoding i'm using in java case (there's no such option 'unicode', guess).

is there work around this?


Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -