我试图用InputStream读取一个资产文件,但它抛出了OutOfMemory异常,文件的大小是22mb(大约2200万字节!)。
This is the code I use
java.io.InputStream is = MainActivity.this.getAssets().open("file.json"); int Si = is.available(); byte[] Bu = new byte[Si]; is.read(Bu); is.close(); data = new String(Bu, "UTF-8"); }catch(Exception e){