Advertisement
FALSkills

Untitled

Aug 8th, 2018
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. public String getBase64EncodedImage(String imageURL) throws IOException {
  2. java.net.URL url = new java.net.URL(imageURL);
  3. InputStream istream = url.openStream();
  4. byte[] bytes = org.apache.commons.io.IOUtils.toByteArray(istream);
  5. return org.apache.commons.codec.binary.Base64.encodeBase64URLSafeString(bytes);
  6. }
  7. //URL url = new URL("http://2captcha.com/in.php?key=MY_KEY&method=base64&body="+base64image);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement