if (total_filled==0 && _inNIOBuffer.length()==0)
{
if(!isOpen())
{
_outNIOBuffer.clear();
throw new EofException();
}
return false;
}
try
{
_inBuffer.position(_inNIOBuffer.getIndex());
_inBuffer.limit(_inNIOBuffer.putIndex());
_result=null;
_result=_engine.unwrap(_inBuffer,buffer);
_inNIOBuffer.skip(_result.bytesConsumed());
}
finally
{
_inBuffer.position(0);
_inBuffer.limit(_inBuffer.capacity());
}
switch(_result.getStatus())
{
case BUFFER_OVERFLOW:
throw new IllegalStateException(_result.toString());
case BUFFER_UNDERFLOW:
if (Log.isDebugEnabled())
Log.debug("unwrap {}",_result);
if(!isOpen())
{
_inNIOBuffer.clear();
_outNIOBuffer.clear();
throw new EofException();
}
return (total_filled > 0);
case CLOSED:
_closing=true;