Code example for FileChannel

Methods: write

		// Open the file and then get a channel from the stream 
		FileOutputStream fos = new FileOutputStream(fullFileName);
		FileChannel fc = fos.getChannel();
		ByteBuffer bb = ByteBuffer.wrap(fileContent);
		// Get the file's size and then map it into memory 
		// int fileSize = fileContent.length; 
		// MappedByteBuffer mbb = FileChannel.MapMode.READ_WRITE, 0, 
		// fileSize); 
		// We write the contents of the file with one shot 
		// mbb.put(fileContent); 
	 * Get's the system's temporary directory 
Stop searching for code, let great code find you!  Add Codota to your java IDE