688 |
|
// Write out array length, for compatibility with 1.5 version |
689 |
|
s.writeInt(Math.max(2, size + 1)); |
690 |
|
|
691 |
< |
// Write out all elements in the proper order. |
691 |
> |
// Write out all elements in the "proper order". |
692 |
|
for (int i = 0; i < size; i++) |
693 |
|
s.writeObject(queue[i]); |
694 |
|
} |
709 |
|
|
710 |
|
queue = new Object[size]; |
711 |
|
|
712 |
< |
// Read in all elements in the proper order. |
712 |
> |
// Read in all elements. |
713 |
|
for (int i = 0; i < size; i++) |
714 |
|
queue[i] = s.readObject(); |
715 |
+ |
|
716 |
+ |
// Elements are guaranteed to be in "proper order", but the |
717 |
+ |
// spec has never explained what that might be. |
718 |
+ |
heapify(); |
719 |
|
} |
720 |
|
} |