png, jpg 파일이 아닌

 

.dat 파일의 정보를 읽어와서 bitmap을 생성하고 싶은데.

 

 InputStream is = null;
         try {
        is = assetManager.open("이미지.dat");
        
               int size = is.available();
                byte[] buffer = new byte[size];
                int[] colors;
                is.read(buffer);
                mBitmap = BitmapFactory.decodeByteArray(buffer, 0, buffer.length);
 
    is.close();
   } catch (IOException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
   }

 

바이트 값도 잘받아오는데 왜 생성을 못하나요??

dat파일은 다른 방법으로 bitmap 파일을 생성해야하나요?

 

 

buffer값만으로 이미지의 width와 height를 알아 낼 수 있는 방도가 있을까요?