Android 读取缓存内lrc的文件并解析

String CacheFilePath =getCacheDir().getAbsolutePath();

String content ="";

File file =new File(path);

try {

InputStream inputStream =new FileInputStream(file);

    if (inputStream !=null){

InputStreamReader reader =new InputStreamReader(inputStream,"UTF16");

        BufferedReader bufferedReader =new BufferedReader(reader);

        String line;

        while ((line = bufferedReader.readLine()) !=null){

content += line +"\n";

        }

inputStream.close();

    }

}catch (Exception e) {

e.printStackTrace();

}

Log.d("111", "getFileContent: content = " + content);

你可能感兴趣的:(Android 读取缓存内lrc的文件并解析)