code: private void registerObjectRead(Object obj, int handle, boolean unshared) throws IOException {
          if (unshared) {
              obj = UNSHARED_OBJ;
          }
          int index = handle - ObjectStreamConstants.baseWireHandle;
          int size = objectsRead.size();
          // ObjectOutputStream sometimes wastes a handle. I've compared hex dumps of the RI
          // and it seems like that's a 'feature'. Look for calls to objectsWritten.put that
          // are guarded by !unshared tests.
          while (index > size) {
              objectsRead.add(null);
              ++size;
          }
          if (index == size) {
              objectsRead.add(obj);
          } else {
              objectsRead.set(index, obj);
          }
      }
docs: Associates a read object with the its serialization handle.