while(actsize < size) {
final Item e;
try {
e = _queue.take();
} catch (InterruptedException ie) {
throw new RemoteException(ie.getMessage(), ie);
}
if(e == SENTINEL) {
break;
}
result[actsize++] = e;
}
final FastMultiByteArrayOutputStream bos = new FastMultiByteArrayOutputStream();
final OutputStream os = compress ? new LZFOutputStream(bos) : bos;
final ObjectOutputStream oos;
try {
oos = new ObjectOutputStream(os);
oos.writeInt(actsize);
for(int i = 0; i < actsize; i++) {
oos.writeObject(result[i]);
result[i] = null;
}
oos.flush();
} catch (IOException e) {
throw new RemoteException("failed to serialize", e);
}
final byte[] ary = bos.toByteArray_clear();
try {
oos.close();
} catch (IOException e) {