/*
 * Decompiled with CFR 0.152.
 */
package com.hst.framework.util;

import com.hst.framework.util.HstCloneUtil;
import java.io.IOException;
import java.io.InputStream;
import java.io.InvalidClassException;
import java.io.ObjectInputStream;
import java.io.ObjectStreamClass;

private static class HstCloneUtil.CloneInput
extends ObjectInputStream {
    private final HstCloneUtil.CloneOutput output;

    HstCloneUtil.CloneInput(InputStream in, HstCloneUtil.CloneOutput output) throws IOException {
        super(in);
        this.output = output;
    }

    protected Class resolveClass(ObjectStreamClass osc) throws IOException, ClassNotFoundException {
        String found;
        Class c = (Class)this.output.classQueue.getFirst();
        this.output.classQueue.removeFirst();
        String expected = osc.getName();
        String string = found = c == null ? null : c.getName();
        if (!expected.equals(found)) {
            throw new InvalidClassException("Classes desynchronized: found " + found + " when expecting " + expected);
        }
        return c;
    }

    protected Class resolveProxyClass(String[] interfaceNames) throws IOException, ClassNotFoundException {
        Class c = (Class)this.output.classQueue.getFirst();
        this.output.classQueue.removeFirst();
        return c;
    }
}
