int fetched = fetchInternal(is);
return fetched;
}
private int fetchInternal(InputStream is) {
final ObjectInputStream ois;
final int fetchedLength;
try {
ois = new ObjectInputStream(is);
fetchedLength = ois.readInt();
} catch (IOException ioe) {
throw new XQRTException("failed to deserialize the fetched items", ioe);
}
try {
for(int i = 0; i < fetchedLength; i++) {
Object ro = ois.readObject();
Item fetched = (Item) ro;
_fetchedQueue.offer(fetched);
}
} catch (IOException ioe) {
throw new XQRTException("failed to deserialize the fetched items", ioe);