Code example for FileReader

Methods: close, read

0
				case 2:  
					Log.d("EditFile.java","test file is changed, because MODIFY");
					try { 
						File file = new File(filePath);
						char[] buffer = new char[(int) file.length()];
						FileReader fileReader = new FileReader(file);
						fileReader.read(buffer,0,(int) file.length());
						Log.d("EditFile.java","the content of file is "+String.copyValueOf(buffer));
						Message m = handler.obtainMessage(1, 1, 1, String.copyValueOf(buffer));
						m.sendToTarget();
						fileReader.close();
					} catch (Exception e) {
						// TODO Auto-generated catch block 
						e.printStackTrace();
					} 
					break; 
				case 8:  
					Log.d("EditFile.java","test file is changed, because CLOSE_WRITE");
					break; 
				case 16:  
					Log.d("EditFile.java","test file is changed, because OPEN READ-ONLY, and CLOSED IT");