/*
 * Decompiled with CFR 0.152.
 * 
 * Could not load the following classes:
 *  com.l7tech.common.http.RerunnableHttpRequest$InputStreamFactory
 *  com.l7tech.common.io.EmptyInputStream
 *  com.l7tech.common.io.IOExceptionThrowingInputStream
 *  com.l7tech.common.mime.NoSuchPartException
 *  com.l7tech.message.MimeKnob
 *  com.l7tech.util.CausedIOException
 */
package com.l7tech.server.policy.assertion;

import com.l7tech.common.http.RerunnableHttpRequest;
import com.l7tech.common.io.EmptyInputStream;
import com.l7tech.common.io.IOExceptionThrowingInputStream;
import com.l7tech.common.mime.NoSuchPartException;
import com.l7tech.message.MimeKnob;
import com.l7tech.server.policy.assertion.ServerHttpRoutingAssertion;
import com.l7tech.util.CausedIOException;
import java.io.IOException;
import java.io.InputStream;

class u
implements RerunnableHttpRequest.InputStreamFactory {
    final MimeKnob val$reqMime;
    private static final String a = u.a(105, u.a("tW\r8@\u00056VU\u00003\\\u00026Z_\u000e3\u000f\u0001wEBM"));

    /*
     * Ignored method signature, as it can't be verified against descriptor
     */
    u(ServerHttpRoutingAssertion serverHttpRoutingAssertion, MimeKnob mimeKnob) {
        this.val$reqMime = mimeKnob;
    }

    public InputStream getInputStream() {
        try {
            Object object;
            try {
                object = this.val$reqMime == null ? new EmptyInputStream() : this.val$reqMime.getEntireMessageBodyAsInputStream();
            }
            catch (NoSuchPartException noSuchPartException) {
                throw u.a(noSuchPartException);
            }
            return object;
        }
        catch (NoSuchPartException noSuchPartException) {
            return new IOExceptionThrowingInputStream((IOException)new CausedIOException(a, (Throwable)noSuchPartException));
        }
        catch (IOException iOException) {
            return new IOExceptionThrowingInputStream(iOException);
        }
    }

    private static NoSuchPartException a(NoSuchPartException noSuchPartException) {
        return noSuchPartException;
    }

    private static char[] a(String string) {
        char[] cArray = string.toCharArray();
        if (cArray.length < 2) {
            cArray = cArray;
            cArray[0] = (char)(cArray[0] ^ 0x7F);
        }
        return cArray;
    }

    /*
     * Handled impossible loop by duplicating code
     * Enabled aggressive block sorting
     */
    private static String a(int n2, char[] cArray) {
        char[] cArray2;
        block11: {
            int n3;
            int n4;
            int n5;
            block10: {
                n5 = n2;
                cArray2 = cArray;
                n4 = cArray.length;
                n3 = 0;
                if (!true) break block10;
                n4 = n4;
                if (n4 <= n3) break block11;
            }
            do {
                n5 = n5;
                cArray2 = cArray2;
                int n6 = n3;
                cArray2[n6] = (char)(cArray2[n6] ^ (n5 ^ (switch (n3 % 7) {
                    case 0 -> 94;
                    case 1 -> 95;
                    case 2 -> 10;
                    case 3 -> 63;
                    case 4 -> 70;
                    case 5 -> 24;
                    default -> 127;
                })));
                ++n3;
                n4 = n4;
            } while (n4 > n3);
        }
        return new String(cArray2).intern();
    }
}

