} else {
assert buffer.hasArray();
byte[] array = buffer.array();
int position = buffer.position();
int limit = buffer.limit();
sizeReceived = socket.receive(array, position, limit);
if (0 < sizeReceived && sizeReceived <= remaining) {
buffer.position(position + sizeReceived);
}
}
} finally {