Code example for ByteArrayEntity

Methods: setContentEncoding

0
			        //zipper.flush(); 
			        //zipper.finish(); 
			        zipper.close();
			         
			         
			        ByteArrayEntity byteEntity = new ByteArrayEntity(baos.toByteArray());
			        //baos.close(); 
			        byteEntity.setContentEncoding("gzip");
			        		         
			        httpPost.setEntity(byteEntity);
	    		} catch (IOException e) {
	    			Log.e(TAG, "Unable to gzip entity, using unzipped entity", e);
	    			httpPost.setEntity(requestEntity);
	    		} 
		         
	        } else { 
	        	httpPost.setEntity(requestEntity);
	        } 
	     
		         
Connect your IDE to all the code out there  Get Codota for Java