protected void write() throws IOException
	{
		if (isNotReady()) {
			return;
		}
		
		long startTime = System.nanoTime();
		
		while (!bufferOut.isEmpty())
		{
			ByteBuffer next = bufferOut.peek();
			
			onWrite( next );
			
			if (next.hasRemaining())
			{
				break;
			}
			
			bufferOut.poll();
			protocol.releaseBuffer( next );
		}
		
		durationWrite = System.nanoTime() - startTime;
	}