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