CopyPastor

Detecting plagiarism made easy.

Score: 0.8636622155547902; Reported for: String similarity Open both answers

Possible Plagiarism

Plagiarized on 2016-08-03
by Nitesh Pareek

Original Post

Original - Posted on 2013-09-28
by sravan



            
Present in both answers; Present only in the new answer; Present only in the old answer;

You can use the Base64 Android class:
String encodedImage = Base64.encodeToString(byteArrayImage, Base64.DEFAULT);

You'll have to convert your image into a byte array though. Here's an example:
Bitmap bm = BitmapFactory.decodeFile("/path/to/image.jpg"); ByteArrayOutputStream baos = new ByteArrayOutputStream(); bm.compress(Bitmap.CompressFormat.JPEG, 100, baos); //bm is the bitmap object byte[] b = baos.toByteArray();
You can use the Base64 Android class: String encodedImage = Base64.encodeToString(byteArrayImage, Base64.DEFAULT); You'll have to convert your image into a byte array though. Here's an example: Bitmap bm = BitmapFactory.decodeFile("/path/to/image.jpg"); ByteArrayOutputStream baos = new ByteArrayOutputStream(); bm.compress(Bitmap.CompressFormat.JPEG, 100, baos); //bm is the bitmap object byte[] b = baos.toByteArray();

        
Present in both answers; Present only in the new answer; Present only in the old answer;