Code example for FileChannel

Methods: write

0
			MappedByteBuffer mBuffer = inChannel.map(FileChannel.MapMode.READ_WRITE, 0, raf.length());
			 
			fos = new FileOutputStream("f:/mysql-5.5.31-win32.zip");
			FileChannel outChannel = fos.getChannel();
			 
			outChannel.write(mBuffer);
			 
		} catch (FileNotFoundException e) {
			e.printStackTrace();
		} catch (IOException e) {
			e.printStackTrace();
		}finally{ 
			if(raf != null)
				raf.close();
			if(fos != null)
				fos.close();
		} 
 
	} 
 
Stop searching for code, let great code find you!  Add Codota to your java IDE