Code example for WritableByteChannel

Methods: write

0
	buffer = ByteBuffer.allocate (count);
	read (buffer, position);
	buffer.flip();
      } 
 
    return target.write (buffer);
  } 
 
  public long transferTo (long position, long count, 
			  WritableByteChannel target)
    throws IOException 
  { 
    if (position < 0
        || count < 0)
      throw new IllegalArgumentException ("position: " + position
					  + ", count: " + count);
 
    if (!isOpen ())
      throw new ClosedChannelException ();
 
    if ((mode & READ) == 0)