// Path: src/com/crossbowffs/quotelock/consts/Urls.java
// public final class Urls {
//     public static final String XPOSED_FORUM = "http://forum.xda-developers.com/xposed";
//     public static final String GITHUB_QUOTELOCK = "https://github.com/apsun/QuoteLock";
//     public static final String GITHUB_QUOTELOCK_ISSUES = GITHUB_QUOTELOCK + "/issues";
// 
//     private Urls() { }
// }


import com.crossbowffs.quotelock.BuildConfig;
import com.crossbowffs.quotelock.consts.Urls;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;
package com.crossbowffs.quotelock.utils;



public class IOUtils {
    public static String streamToString(InputStream inputStream, String encoding, int bufferSize) throws IOException {
        char[] buffer = new char[bufferSize];
        StringBuilder sb = new StringBuilder();
        try (InputStreamReader reader = new InputStreamReader(inputStream, encoding)) {
            while (true) {
                int count = reader.read(buffer, 0, bufferSize);
                if (count < 0) break;
                sb.append(buffer, 0, count);
            }
        }
        return sb.toString();
    }

    public static String streamToString(InputStream inputStream) throws IOException {
        return streamToString(inputStream, "UTF-8", 2048);
    }

    public static String downloadString(String urlString) throws IOException {
        URL url = new URL(urlString);
// Path: src/com/crossbowffs/quotelock/consts/Urls.java
// public final class Urls {
//     public static final String XPOSED_FORUM = "http://forum.xda-developers.com/xposed";
//     public static final String GITHUB_QUOTELOCK = "https://github.com/apsun/QuoteLock";
//     public static final String GITHUB_QUOTELOCK_ISSUES = GITHUB_QUOTELOCK + "/issues";
// 
//     private Urls() { }
// }


// Path: src/com/crossbowffs/quotelock/utils/IOUtils.java
import com.crossbowffs.quotelock.BuildConfig;
import com.crossbowffs.quotelock.consts.Urls;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;

package com.crossbowffs.quotelock.utils;



public class IOUtils {
    public static String streamToString(InputStream inputStream, String encoding, int bufferSize) throws IOException {
        char[] buffer = new char[bufferSize];
        StringBuilder sb = new StringBuilder();
        try (InputStreamReader reader = new InputStreamReader(inputStream, encoding)) {
            while (true) {
                int count = reader.read(buffer, 0, bufferSize);
                if (count < 0) break;
                sb.append(buffer, 0, count);
            }
        }
        return sb.toString();
    }

    public static String streamToString(InputStream inputStream) throws IOException {
        return streamToString(inputStream, "UTF-8", 2048);
    }

    public static String downloadString(String urlString) throws IOException {
        URL url = new URL(urlString);
        String ua = String.format("QuoteLock/%s (+%s)", BuildConfig.VERSION_NAME, Urls.GITHUB_QUOTELOCK);