public FileChannelOutputStream(FileChannel channel,boolean append) throws IOException {
  this.channel=channel;
  if (append) {
    channel.position(channel.size());
  }
 else {
    channel.position(0);
    channel.truncate(0);
  }
}

public FileChannelOutputStream ( FileChannel channel , boolean append ) throws IOException { this . channel = channel ; if ( append ) { channel . position ( channel . size ( ) ) ; } else { channel . position ( 0 ) ; channel . truncate ( 0 ) ; } }
create a new file object output stream from the file channel .
