Code example for ByteArrayEntity

Methods: setContentEncoding

0
        //} else { 
            ByteArrayOutputStream arr = new ByteArrayOutputStream();
            OutputStream zipper = new GZIPOutputStream(arr);
            zipper.write(data);
            zipper.close();
            entity = new ByteArrayEntity(arr.toByteArray());
            entity.setContentEncoding("gzip");
        //} 
        return entity;
    } 
 
    /** 
     * Retrieves the minimum size for compressing data. 
     * Shorter data will not be compressed. 
      
    public static long getMinGzipSize(ContentResolver resolver) { 
        String sMinGzipBytes = Settings.Gservices.getString(resolver, 
                Settings.Gservices.SYNC_MIN_GZIP_BYTES); 
 
        if (!TextUtils.isEmpty(sMinGzipBytes)) { 
Contextual code suggestions in your IDE  Get Codota for Java