byte array to String in Android
问题 I need a way to convert a byte[] to a String without creating a new String object. What I don't want: String s= new String(byte[], int offset, int byteCount); Is there another way to achieve the same thing without creating a new String object? I've been looking at Base64 class. Does that work? 回答1: This would only be possible if somewhere you had a cache of the strings generated from every input you're going to get. Strings are immutable, so you can't put the new data into an existing string