Tabnine Logo
Base64.encodeFromFile
Code IndexAdd Tabnine to your IDE (free)

How to use
encodeFromFile
method
in
org.apache.chemistry.opencmis.commons.impl.Base64

Best Java code snippets using org.apache.chemistry.opencmis.commons.impl.Base64.encodeFromFile (Showing top 2 results out of 315)

origin: org.apache.chemistry.opencmis/chemistry-opencmis-commons-impl

/**
 * Reads <tt>infile</tt> and encodes it to <tt>outfile</tt>.
 * 
 * @param infile
 *            Input file
 * @param outfile
 *            Output file
 * @throws java.io.IOException
 *             if there is an error
 * @since 2.2
 */
public static void encodeFileToFile(String infile, String outfile) throws java.io.IOException {
  String encoded = Base64.encodeFromFile(infile);
  java.io.OutputStream out = null;
  try {
    out = new java.io.BufferedOutputStream(new java.io.FileOutputStream(outfile));
    out.write(encoded.getBytes("US-ASCII")); // Strict, 7-bit output.
  } // end try
  catch (java.io.IOException e) {
    throw e; // Catch and release to execute finally{}
  } // end catch
  finally {
    IOUtils.closeQuietly(out);
  } // end finally
} // end encodeFileToFile
origin: org.apache.chemistry.opencmis/chemistry-opencmis-android-client

/**
 * Reads <tt>infile</tt> and encodes it to <tt>outfile</tt>.
 * 
 * @param infile
 *            Input file
 * @param outfile
 *            Output file
 * @throws java.io.IOException
 *             if there is an error
 * @since 2.2
 */
public static void encodeFileToFile(String infile, String outfile) throws java.io.IOException {
  String encoded = Base64.encodeFromFile(infile);
  java.io.OutputStream out = null;
  try {
    out = new java.io.BufferedOutputStream(new java.io.FileOutputStream(outfile));
    out.write(encoded.getBytes("US-ASCII")); // Strict, 7-bit output.
  } // end try
  catch (java.io.IOException e) {
    throw e; // Catch and release to execute finally{}
  } // end catch
  finally {
    IOUtils.closeQuietly(out);
  } // end finally
} // end encodeFileToFile
org.apache.chemistry.opencmis.commons.implBase64encodeFromFile

Javadoc

Convenience method for reading a binary file and base64-encoding it.

As of v 2.3, if there is a error, the method will throw an java.io.IOException. This is new to v2.3! In earlier versions, it just returned false, but in retrospect that's a pretty poor way to handle it.

Popular methods of Base64

  • encodeBytes
    Encodes a byte array into Base64 notation. Example options: GZIP: gzip-compresses object before enc
  • decode
    Low-level access to decoding ASCII characters in the form of a byte array. Ignores GUNZIP option, i
  • decode4to3
    Decodes four bytes from array source and writes the resulting bytes (up to three of them) to destina
  • decodeFromFile
    Convenience method for reading a base64-encoded file and decoding it. As of v 2.3, if there is a err
  • decodeToObject
    Attempts to decode Base64 data and deserialize a Java Object within. Returns null if there was an e
  • encode3to4
    Encodes up to the first three bytes of array threeBytes and returns a four-byte array in Base64 nota
  • encodeBytesToBytes
    Similar to #encodeBytes(byte[],int,int,int) but returns a byte array instead of instantiating a Stri
  • encodeObject
    Serializes an object and returns the Base64-encoded version of that serialized object. As of v 2.3,
  • getAlphabet
    Returns one of the _SOMETHING_ALPHABET byte arrays depending on the options specified. It's possible
  • getDecodabet
    Returns one of the _SOMETHING_DECODABET byte arrays depending on the options specified. It's possibl

Popular in Java

  • Making http requests using okhttp
  • setRequestProperty (URLConnection)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • onCreateOptionsMenu (Activity)
  • BorderLayout (java.awt)
    A border layout lays out a container, arranging and resizing its components to fit in five regions:
  • Connection (java.sql)
    A connection represents a link from a Java application to a database. All SQL statements and results
  • Properties (java.util)
    A Properties object is a Hashtable where the keys and values must be Strings. Each property can have
  • TreeMap (java.util)
    Walk the nodes of the tree left-to-right or right-to-left. Note that in descending iterations, next
  • ReentrantLock (java.util.concurrent.locks)
    A reentrant mutual exclusion Lock with the same basic behavior and semantics as the implicit monitor
  • ZipFile (java.util.zip)
    This class provides random read access to a zip file. You pay more to read the zip file's central di
  • Best plugins for Eclipse
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now