Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public String getBase64EncodedImage(String imageURL) throws IOException {
- java.net.URL url = new java.net.URL(imageURL);
- InputStream istream = url.openStream();
- byte[] bytes = org.apache.commons.io.IOUtils.toByteArray(istream);
- return org.apache.commons.codec.binary.Base64.encodeBase64URLSafeString(bytes);
- }
- //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