Java Code examples for Org.apache.commons.codec.binary.Base64InputStream__Java

Source: Internet
Author: User
Tags base64
Java Code examples for Org.apache.commons.codec.binary.Base64InputStream

The following are top voted examples for showing. These examples are extracted from open source projects. You can vote up the examples your like and your votes'll be used with our system to product for more good examples.


The base64 application of Apache Commons codec converts files, strings, and byte to Base64.

Example 1

Project:burrow-java File:Encoder.java View Source code Vote up 6 votes
public static int[] Unpack (String S) {
    try {
        Bytearrayinputstream base = new Bytearrayinputstream (S.getbytes ());
        ObjectInputStream ois = new ObjectInputStream (new Base64inputstream (base));
        Int[] result = (int[]) ois.readobject ();
        Ois.close ();
        return result;
    } catch (classcastexception CCE) {
        System.err.println ("error:malformed job");
        System.exit (1);
    }  catch (IOException IoE) {
        //shouldn ' t is possible from a in memory source
    } catch (ClassNotFoundException Cnfe) {
        //impossible, pretty sure int[] exists everywhere
    }
    throw new Error ("Should not be reached.");
}
 
Example 2
Project:wps File:IOUtils.java View Source code Vote up 6 votes
public static File Writebase64tofile (InputStream input, String extension)
		throws IOException {

       file File = file.c Reatetempfile (
               "file" + uuid.randomuuid (),
               "." + extension,
               new file (System.getproperty ("Java.io.tmpdir ")));
       OutputStream outputstream = null;
       try {
           outputstream = new FileOutputStream (file);
           Copylarge (new Base64inputstream (input), outputstream);
       } finally {
           closequietly (outputstream);
       }

	return file;
}
 
Example 3
Project:opensearchserver File:StreamLimiterBase64.java View Source code Vote up 6 votes
@Override
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.