안드로이드 개발 질문/답변
(글 수 45,052)
try {
reader = new FileReader(filePath);
} catch (FileNotFoundException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
bufferReader = new BufferedReader(reader);
char[] thumbBuf= new char[size];
try {
bufferReader.read(thumbBuf, 0, size);
} catch (IOException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
위에는 대략 파일을 읽은 거구요...
thumbBuf를 통해 이미지 디코딩을 하려고 하는데..
String srt = String.valueOf(thumbBuf);
이렇게 스트링 데이터로 바꾸고...
byte[] byteArray = EncodingUtils.getBytes(str, "Latin-1") ;
ByteArrayInputStream bytes = new ByteArrayInputStream(byteArray);
Bitmap image = BitmapFactory.decodeStream(bytes);
위와 같이 디코딩을 해봤더니 실패합니당...
잘 알지 못하는 상태에서 해서 어디가 문제인지 모르겠네요..ㅠ



