//System.out.println("ENTER underflow");
synchronized (fragmentQueue) {
if (receivedCancel) {
throw new RequestCanceledException(cancelReqId);
}
while (fragmentQueue.size() == 0) {
if (endOfStream) {
throw wrapper.endOfStream() ;
}
boolean interrupted = false;
try {
fragmentQueue.wait(FRAGMENT_TIMEOUT);
} catch (InterruptedException e) {
interrupted = true;
}
if (!interrupted && fragmentQueue.size() == 0) {
throw wrapper.bufferReadManagerTimeout();
}
if (receivedCancel) {
throw new RequestCanceledException(cancelReqId);
}
}
result = fragmentQueue.dequeue();
result.fragmented = true;