public static void main(String[] args) throws Exception {
		
		FileOutputStream fos = new FileOutputStream("CharacterStreamTest.txt");
		
		OutputStreamWriter osw = new OutputStreamWriter(fos);
		
		BufferedWriter bos = new BufferedWriter(osw);
		
		bos.write("www.baidu.com");
		bos.write("\n");
		bos.write("\n");
		bos.write("www.google.com");
		
		bos.close();
		
		FileInputStream fis = new FileInputStream("CharacterStreamTest.txt");
		
		InputStreamReader isr = new InputStreamReader(fis);
		
		BufferedReader br = new BufferedReader(isr);
		
//		System.out.println(br.readLine());
//		System.out.println(br.readLine());
//		System.out.println(br.readLine());
//		System.out.println(br.readLine());
		
		String str = br.readLine();
		
		while(null != str)
		{
			System.out.println(str);
			
			str = br.readLine();
		}
		
		br.close();
	}