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 
Contextual code suggestions in your IDE  Get Codota for Java