nio 简单问题

while(selector.selectedKeys().iterator().hasNetx())
{
SelectionKey key = (SelectionKey)itor.next();
itor.remove();
if(key.isWritable()){}
}

问题:我如何才能向指定的SocketChannel写我要的数据?

参考我的书籍<Java实用系统开发指南>第一章。