正在加载图片...
Write String FILENAME=“ custom千i1e.txt String file Content =This is a test!"i / Create a file to write / Two parameters are passed, file name and mode Fileoutputstream fos openFileoutput (FILENAME, Context MODE PRIVATE; fos. write(fileContent getBytes o); fos. close o; / Read FileInputstream fis open FileInput( FILENAMe); int byte Charj While((byte Char fis read o)!=-1) System. out. printIn((char )byte Char); fis. closed com.example. dumn 2014-09-0600:27dwx-X-Xx b C cache 2014-08-240709dww-x 自 custom file. bt 2014-09-0600:25-rw-r--- 201409-0600:27| WXIwxrWX->/data/a21 // Write String FILENAME = “custom_file.txt"; String fileContent = “This is a test!"; // Create a file to write // Two parameters are passed, file name and mode FileOutputStream fos = openFileOutput(FILENAME, Context.MODE_PRIVATE); fos.write(fileContent.getBytes()); fos.close(); // Read FileInputStream fis = openFileInput(FILENAME); int byteChar; while((byteChar = fis.read()) != -1) { System.out.println((char) byteChar); } fis.close()
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有