package o; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.StringWriter; import java.io.UnsupportedEncodingException; /* renamed from: o.bvy, reason: case insensitive filesystem */ /* loaded from: classes2.dex */ public final class C5595bvy { public static String d(InputStream inputStream, String str) throws UnsupportedEncodingException, IOException { StringWriter stringWriter = new StringWriter(); InputStreamReader inputStreamReader = new InputStreamReader(inputStream, str); char[] cArr = new char[4096]; while (true) { int read = inputStreamReader.read(cArr); if (-1 == read) { return stringWriter.toString(); } stringWriter.write(cArr, 0, read); } } public static PoK c(String str, String str2) { char c; if (str == null) { if (str2 != null) { if (str2.contains("connect-drcn")) { return PoK.a; } if (str2.contains("connect-dre")) { return PoK.c; } if (str2.contains("connect-drru")) { return PoK.e; } if (str2.contains("connect-dra")) { return PoK.d; } } return PoK.b; } str.hashCode(); int hashCode = str.hashCode(); if (hashCode == 2155) { if (str.equals("CN")) { c = 0; } c = 65535; } else if (hashCode == 2177) { if (str.equals("DE")) { c = 1; } c = 65535; } else if (hashCode != 2627) { if (hashCode == 2644 && str.equals("SG")) { c = 3; } c = 65535; } else { if (str.equals("RU")) { c = 2; } c = 65535; } return c != 0 ? c != 1 ? c != 2 ? c != 3 ? PoK.b : PoK.d : PoK.e : PoK.c : PoK.a; } public static String b(String str) { int i = 0; if (str.length() > 0) { while (str.charAt(i) == '/') { i++; } } StringBuilder sb = new StringBuilder("/"); sb.append(str.substring(i)); return sb.toString(); } }