private void genPhoto() { photo.setPartyId(entity.getPartyId()); photo.setName(entity.getPartyface()); byte[] input = ImageUtil.Bitmap2Bytes(bitMap); byte[] newly = Base64.encode(input, Base64.DEFAULT); photo.setContent(new String(newly)); photo.setPhotoUpdateDate(DateTimeUtil.format(new Date())); }