[android] 从 SDcard 中进行文件的读取操作,含中文和数字

当需要从 SDcard 中读取含有中文的文件时,字节定义应为 byte buffbyte = new byte[1024],正常为 byte[20] 即可。


FileInputStream fin = null ;
BufferedInputStream buffin = null ;
		
try{
	fin = openFileInput(MUSICFILE) ;
	buffin = new BufferedInputStream(fin) ;
			
	DataInputStream dis = new DataInputStream(fin) ;
	int length = dis.available() ;
	byte[] buffbyte = new byte[length] ;//这样可灵活的读取
}
	buffin.close() ;
			
}catch(Exception e){
	e.printStackTrace() ;
}




你可能感兴趣的:(android,File)