// Path: BoincRpc/src/main/java/edu/berkeley/boinc/Md5.java
// public class Md5 {
//     public static final String TAG = "Md5";
// 
//     /**
//      * Hashes the input string
//      *
//      * @param text The text to be hashed
//      * @return The hash of the input converted to string
//      */
//     public final static String hash(String text) {
//         try {
//             MessageDigest md5 = MessageDigest.getInstance("MD5");
//             md5.update(text.getBytes("iso-8859-1"), 0, text.length());
//             byte[] md5hash = md5.digest();
//             StringBuilder sb = new StringBuilder();
//             for (int i = 0; i < md5hash.length; ++i) {
//                 sb.append(String.format("%02x", md5hash[i]));
//             }
//             return sb.toString();
//         }
//         catch (Exception e) {
//             Log.w(TAG, "Error when calculating MD5 hash");
//             return "";
//         }
//     }
// }
// 
// Path: BoincRpc/src/androidTest/java/edu/berkeley/boinc/testutil/BoincClientStub.java
// public enum Behavior {
//     DEFAULT,
//     NO_REPLY,
//     FAILURE,
//     TRUNCATED_DATA
// }


import edu.berkeley.boinc.Md5;
import edu.berkeley.boinc.testutil.BoincClientStub.Behavior;
import android.util.Log;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.net.Socket;
/*
 * AndroBOINC - BOINC Manager for Android
 * Copyright (C) 2010 - 2016, Pavol Michalec
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 */

package edu.berkeley.boinc.testutil;



public class BoincClientStubWorker {
    private static final String TAG = "BoincClientStubWorker";

    private static final int READ_BUF_SIZE = 8192;

    private Socket mSocket;
    private PrintWriter mOutput;
    private BufferedReader mInput;
    private StringBuilder mStringBuilder = new StringBuilder();
    private boolean mProcessing = false;
// Path: BoincRpc/src/main/java/edu/berkeley/boinc/Md5.java
// public class Md5 {
//     public static final String TAG = "Md5";
// 
//     /**
//      * Hashes the input string
//      *
//      * @param text The text to be hashed
//      * @return The hash of the input converted to string
//      */
//     public final static String hash(String text) {
//         try {
//             MessageDigest md5 = MessageDigest.getInstance("MD5");
//             md5.update(text.getBytes("iso-8859-1"), 0, text.length());
//             byte[] md5hash = md5.digest();
//             StringBuilder sb = new StringBuilder();
//             for (int i = 0; i < md5hash.length; ++i) {
//                 sb.append(String.format("%02x", md5hash[i]));
//             }
//             return sb.toString();
//         }
//         catch (Exception e) {
//             Log.w(TAG, "Error when calculating MD5 hash");
//             return "";
//         }
//     }
// }
// 
// Path: BoincRpc/src/androidTest/java/edu/berkeley/boinc/testutil/BoincClientStub.java
// public enum Behavior {
//     DEFAULT,
//     NO_REPLY,
//     FAILURE,
//     TRUNCATED_DATA
// }


// Path: BoincRpc/src/androidTest/java/edu/berkeley/boinc/testutil/BoincClientStubWorker.java
import edu.berkeley.boinc.Md5;
import edu.berkeley.boinc.testutil.BoincClientStub.Behavior;
import android.util.Log;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.net.Socket;

/*
 * AndroBOINC - BOINC Manager for Android
 * Copyright (C) 2010 - 2016, Pavol Michalec
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 */

package edu.berkeley.boinc.testutil;



public class BoincClientStubWorker {
    private static final String TAG = "BoincClientStubWorker";

    private static final int READ_BUF_SIZE = 8192;

    private Socket mSocket;
    private PrintWriter mOutput;
    private BufferedReader mInput;
    private StringBuilder mStringBuilder = new StringBuilder();
    private boolean mProcessing = false;
    private Behavior mBehavior = Behavior.DEFAULT;