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) {
        return DEFAULT_SYNC_MIN_GZIP_BYTES; // For now, this is just a constant.
    } 
 
    /* cURL logging support. */