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);
		} 
 
 
Stop searching for code, let great code find you!  Add Codota to your java IDE