Code example for FileChannel

Methods: close, write

0
		 
		file = new File("123.txt");
		 
		fc = new FileOutputStream(file).getChannel();
		 
		fc.write(ByteBuffer.wrap("sss text".getBytes()));
		 
		fc.close();
		 
		//BufferedOutputStream out = new BufferedOutputStream(new FileOutputStream(file)); 
		 
		BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(file)));
		 
		bw.write("fffffffff");
		 
		bw.close();
	} 
 
}