public @NotNull SerializedStubTree reSerialize(@NotNull StubTreeSerializer newSerializationManager,
                                                 @NotNull StubForwardIndexExternalizer<?> newForwardIndexSerializer) throws IOException {
    BufferExposingByteArrayOutputStream outStub = new BufferExposingByteArrayOutputStream();
    ((SerializationManagerEx)mySerializationManager).reSerialize(new ByteArrayInputStream(myTreeBytes, 0, myTreeByteLength), outStub, newSerializationManager);

    byte[] reSerializedIndexBytes;
    int reSerializedIndexByteLength;

    if (myStubIndexesExternalizer == newForwardIndexSerializer) {
      reSerializedIndexBytes = myIndexedStubBytes;
      reSerializedIndexByteLength = myIndexedStubByteLength;
    }
    else {
      BufferExposingByteArrayOutputStream reSerializedStubIndices = new BufferExposingByteArrayOutputStream();
      newForwardIndexSerializer.save(new DataOutputStream(reSerializedStubIndices), getStubIndicesValueMap());
      reSerializedIndexBytes = reSerializedStubIndices.getInternalBuffer();
      reSerializedIndexByteLength = reSerializedStubIndices.size();
    }

    return new SerializedStubTree(
      outStub.getInternalBuffer(),
      outStub.size(),
      reSerializedIndexBytes,
      reSerializedIndexByteLength,
      myDeserializedIndexedStubs.myMap,
      newForwardIndexSerializer,
      newSerializationManager
    );
  }
public @NotNull SerializedStubTree reSerialize(@NotNull StubTreeSerializer newSerializationManager,
                                                 @NotNull StubForwardIndexExternalizer<?> newForwardIndexSerializer)