下载文件到本地,mp3文件正常播放,lrc文件全部乱码!求解~~
public File write2SDFromInput(String path, String fileName, InputStream input){
File file = null;
OutputStream output = null;
try {
createSDDir(path);
file = createFileInSDCard(fileName, path);
output = new FileOutputStream(file);
byte[] buffer = new byte[8*1024];
int temp;
while ((temp = input.read(buffer)) != -1) {
output.write(buffer, 0, temp);
Log.d("mt", "buffer -->" + buffer.toString());
}
output.flush();
} catch (Exception e) {
e.printStackTrace();
}
finally{
try {
output.close();
} catch (Exception e2) {
e2.printStackTrace();
}
}
return file;
}