Here you can find the source of writeFully(FileChannel channel, ByteBuffer fileInfosBuffer)
static void writeFully(FileChannel channel, ByteBuffer fileInfosBuffer) throws IOException
//package com.java2s; //License from project: Apache License import java.nio.channels.FileChannel; import java.nio.ByteBuffer; import java.io.IOException; public class Main { static void writeFully(FileChannel channel, ByteBuffer fileInfosBuffer) throws IOException { while (fileInfosBuffer.hasRemaining()) { channel.write(fileInfosBuffer); }/*from w ww. j a v a 2s . co m*/ } }