I have used the below code to convert Charsequence to Byte Array. Then I save the Byte Array as Blob to my Sqlite Database.
For this , I have used the below code,
public static byte[] toByteArray(CharSequence charSequence) {
if (charSequence == null) {
return null;
}
byte[] barr = new byte[charSequence.length()];
for (int i = 0; i < barr.length; i++) {
barr[i] = (byte) charSequence.charAt(i);
}
return barr;
}
Now I would like to convert my byte array retrieved from sqlite to Charsequence. But I couldn't get any help on it.
How to convert Byte Array to Charsequence?
Any help is much appreciated.
CharSequenceis an interface, so you need an actual implementation to put your byte array into...