안드로이드

안드로이드 sd 카드에 로그 저장 하기(덤프뜨기)

MR 손 2013. 3. 11. 17:29

// 쓰기

FileOutputStream fos 

new FileOutputStream(Environment.getExternalStorageDirectory().toString() + "/" + "파일명.dump");

fos.write(buf); //byte[]

fos.close();


//읽기

File file = new File(Environment.getExternalStorageDirectory().toString() + "/" + "파일명.dump");

FileInputStream fis = new FileInputStream(file);

int length = (int) file.length();

byte[] readBuf = new byte[length];

fis.read(readBuf);

fis.close();