package com.parse;

import com.parse.http.ParseHttpBody;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.io.UnsupportedEncodingException;

/* JADX INFO: loaded from: classes.dex */
public class ParseByteArrayHttpBody extends ParseHttpBody {
    public final byte[] content;

    /* JADX WARN: Illegal instructions before constructor call */
    public ParseByteArrayHttpBody(String str, String str2) throws UnsupportedEncodingException {
        byte[] bytes = str.getBytes("UTF-8");
        super(str2, bytes.length);
        this.content = bytes;
        new ByteArrayInputStream(bytes);
    }

    public ParseByteArrayHttpBody(byte[] bArr, String str) {
        super(str, bArr.length);
        this.content = bArr;
        new ByteArrayInputStream(bArr);
    }

    @Override // com.parse.http.ParseHttpBody
    public void writeTo(OutputStream outputStream) throws IOException {
        if (outputStream == null) {
            throw new IllegalArgumentException("Output stream may not be null");
        }
        outputStream.write(this.content);
    }
}
