code: public void writeExternal(ObjectOutput out) throws IOException
     {
        int length = remove.size();
        out.writeInt(length);
        for (int i = 0; i < length; i++)
        {
           out.writeUTF(remove.get(i));
        }
        out.flush();
        for (Document doc : add)
        {
           // Indicate that there is a doc to come
           out.writeBoolean(true);
           // boost
           out.writeFloat(doc.getBoost());
           List<Fieldable> fields = doc.getFields();
           int l = fields.size();
           out.writeInt(l);
           for (int i = 0; i < l; i++)
           {
              writeField(out, fields.get(i));
           }
           out.flush();
        }
        // There is no doc anymore
        out.writeBoolean(false);
     }
docs: {@inheritDoc}