Java 类org.apache.http.entity.ByteArrayEntityHC4 实例源码

项目:PeSanKita-android    文件:OutgoingLegacyMmsConnection.java   
private HttpUriRequest constructRequest(byte[] pduBytes, boolean useProxy)
    throws IOException
{
  try {
    HttpPostHC4 request = new HttpPostHC4(apn.getMmsc());
    for (Header header : getBaseHeaders()) {
      request.addHeader(header);
    }

    request.setEntity(new ByteArrayEntityHC4(pduBytes));
    if (useProxy) {
      HttpHost proxy = new HttpHost(apn.getProxy(), apn.getPort());
      request.setConfig(RequestConfig.custom().setProxy(proxy).build());
    }
    return request;
  } catch (IllegalArgumentException iae) {
    throw new IOException(iae);
  }
}
项目:Cable-Android    文件:OutgoingLegacyMmsConnection.java   
private HttpUriRequest constructRequest(byte[] pduBytes, boolean useProxy)
    throws IOException
{
  try {
    HttpPostHC4 request = new HttpPostHC4(apn.getMmsc());
    for (Header header : getBaseHeaders()) {
      request.addHeader(header);
    }

    request.setEntity(new ByteArrayEntityHC4(pduBytes));
    if (useProxy) {
      HttpHost proxy = new HttpHost(apn.getProxy(), apn.getPort());
      request.setConfig(RequestConfig.custom().setProxy(proxy).build());
    }
    return request;
  } catch (IllegalArgumentException iae) {
    throw new IOException(iae);
  }
}
项目:TextSecure    文件:OutgoingMmsConnection.java   
@Override
protected HttpUriRequest constructRequest(boolean useProxy)
    throws IOException
{
  try {
    HttpPostHC4 request = new HttpPostHC4(apn.getMmsc());
    request.addHeader("Accept", "*/*, application/vnd.wap.mms-message, application/vnd.wap.sic");
    request.addHeader("x-wap-profile", "http://www.google.com/oha/rdf/ua-profile-kila.xml");
    request.addHeader("Content-Type", "application/vnd.wap.mms-message");
    request.setEntity(new ByteArrayEntityHC4(mms));
    if (useProxy) {
      HttpHost proxy = new HttpHost(apn.getProxy(), apn.getPort());
      request.setConfig(RequestConfig.custom().setProxy(proxy).build());
    }
    return request;
  } catch (IllegalArgumentException iae) {
    throw new IOException(iae);
  }
}
项目:TextSecureSMP    文件:OutgoingLegacyMmsConnection.java   
private HttpUriRequest constructRequest(byte[] pduBytes, boolean useProxy)
    throws IOException
{
  try {
    HttpPostHC4 request = new HttpPostHC4(apn.getMmsc());
    for (Header header : getBaseHeaders()) {
      request.addHeader(header);
    }

    request.setEntity(new ByteArrayEntityHC4(pduBytes));
    if (useProxy) {
      HttpHost proxy = new HttpHost(apn.getProxy(), apn.getPort());
      request.setConfig(RequestConfig.custom().setProxy(proxy).build());
    }
    return request;
  } catch (IllegalArgumentException iae) {
    throw new IOException(iae);
  }
}
项目:Silence    文件:OutgoingLegacyMmsConnection.java   
private HttpUriRequest constructRequest(byte[] pduBytes, boolean useProxy)
    throws IOException
{
  try {
    HttpPostHC4 request = new HttpPostHC4(apn.getMmsc());
    for (Header header : getBaseHeaders()) {
      request.addHeader(header);
    }

    request.setEntity(new ByteArrayEntityHC4(pduBytes));
    if (useProxy) {
      HttpHost proxy = new HttpHost(apn.getProxy(), apn.getPort());
      request.setConfig(RequestConfig.custom().setProxy(proxy).build());
    }
    return request;
  } catch (IllegalArgumentException iae) {
    throw new IOException(iae);
  }
}
项目:Securecom-Messaging    文件:OutgoingMmsConnection.java   
@Override
protected HttpUriRequest constructRequest(boolean useProxy)
    throws IOException
{
  HttpPostHC4 request = new HttpPostHC4(apn.getMmsc());
  request.addHeader("Accept", "*/*, application/vnd.wap.mms-message, application/vnd.wap.sic");
  request.addHeader("x-wap-profile", "http://www.google.com/oha/rdf/ua-profile-kila.xml");
  request.addHeader("Content-Type", "application/vnd.wap.mms-message");
  request.setEntity(new ByteArrayEntityHC4(mms));
  if (useProxy) {
    HttpHost proxy = new HttpHost(apn.getProxy(), apn.getPort());
    request.setConfig(RequestConfig.custom().setProxy(proxy).build());
  }
  return request;
}