/** * Deserializes the data held in this object to the stream specified. * <p> * The first serializable subclass must call this method from * <code>readObject</code>. * * @param inputStream the stream to read the object from * @throws IOException if any error occurs while reading from the stream * @throws ClassNotFoundException if a class read from the stream can not be loaded */ @SuppressWarnings("unchecked") protected void doReadObject(final ObjectInputStream inputStream) throws IOException, ClassNotFoundException { init(); final int size = inputStream.readInt(); for (int i = 0; i < size; i++) { add((E) inputStream.readObject()); } }
@Override public void add(final int index, final E obj) { rangeCheck(index, size + 1); checkModCount(); parent.add(index + offset, obj); expectedModCount = parent.modCount; size++; LinkedSubList.this.modCount++; }