@SuppressWarnings("resource")
	private final void write(SelectionKey key) {
		SocketChannel socketChannel = (SocketChannel) key.channel();
		synchronized (mPendingWriteData) {
			LinkedList<ByteBuffer> list = mPendingWriteData.get(socketChannel);
			if (list == null || list.isEmpty()) {
				key.interestOps(SelectionKey.OP_READ);
			} else {
				ByteBuffer buffer = list.getFirst();
				try {
					socketChannel.write(buffer);
				} catch (IOException ioe) {
					mPendingWriteData.remove(socketChannel);
					key.interestOps(SelectionKey.OP_READ);
					return;
				}
				if (buffer.remaining() == 0) {
					list.removeFirst();
					if (list.isEmpty()) {
						key.interestOps(SelectionKey.OP_READ);
					}
				}
			}
		}
	}