How to read file in raw then cover byte to image via android

2020-03-26 android image byte inputstream bufferedreader

I am new Android programmer , my co-work give me a file , it's byte file , I can read it just use this way:

     String ret = "";
     InputStream is = getResources().openRawResource(R.raw.iconbinary); 
     if (is != null) {
       InputStreamReader inputStreamReader = new InputStreamReader(is);
       BufferedReader bufferedReader = new BufferedReader(inputStreamReader);
       String receiveString = "";
       StringBuilder stringBuilder = new StringBuilder();
       while ((receiveString = bufferedReader.readLine()) != null) {
       ret = stringBuilder.toString(); 

Yes , ret will show content like this :


my co-work say this is bytes , I need to cover bytes to image..

but I don't know how to do , please help me.


0x42... is hex , I need to hex2Base64 , any fxn can do that ?