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) {
          stringBuilder.append(receiveString);
       }
       is.close();  
       ret = stringBuilder.toString(); 
     }

Yes , ret will show content like this :

0x424D7619000000000000760000002800000050000000A0000000010004000000000000190000120B0000120B0000000000000000000....more

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.

[EDIT]

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

Answers

Related