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

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

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

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

return encodeBytes(source, 0, source.length, options);
origin: org.apache.chemistry.opencmis/chemistry-opencmis-android-client

return encodeBytes(source, 0, source.length, options);
origin: org.apache.chemistry.opencmis/chemistry-opencmis-android-client

/**
 * Encodes a byte array into Base64 notation. Does not GZip-compress data.
 * 
 * @param source
 *            The data to convert
 * @return The data in Base64-encoded form
 * @throws NullPointerException
 *             if source array is null
 * @since 1.4
 */
public static String encodeBytes(byte[] source) {
  // Since we're not going to have the GZIP encoding turned on,
  // we're not going to have an java.io.IOException thrown, so
  // we should not force the user to have to catch it.
  String encoded = null;
  try {
    encoded = encodeBytes(source, 0, source.length, NO_OPTIONS);
  } catch (java.io.IOException ex) {
    assert false : ex.getMessage();
  } // end catch
  assert encoded != null;
  return encoded;
} // end encodeBytes
origin: org.apache.chemistry.opencmis/chemistry-opencmis-commons-impl

/**
 * Encodes a byte array into Base64 notation. Does not GZip-compress data.
 * 
 * @param source
 *            The data to convert
 * @return The data in Base64-encoded form
 * @throws NullPointerException
 *             if source array is null
 * @since 1.4
 */
public static String encodeBytes(byte[] source) {
  // Since we're not going to have the GZIP encoding turned on,
  // we're not going to have an java.io.IOException thrown, so
  // we should not force the user to have to catch it.
  String encoded = null;
  try {
    encoded = encodeBytes(source, 0, source.length, NO_OPTIONS);
  } catch (java.io.IOException ex) {
    assert false : ex.getMessage();
  } // end catch
  assert encoded != null;
  return encoded;
} // end encodeBytes
origin: org.springframework.social/spring-social-alfresco-bm

/**
 * Creates a basic authentication header value from a username and a
 * password.
 */
protected List<String> createBasicAuthHeaderValue(String username, String password) {
  if (password == null) {
    password = "";
  }
  try {
    return Collections.singletonList("Basic "
        + Base64.encodeBytes((username + ":" + password).getBytes("ISO-8859-1")));
  } catch (UnsupportedEncodingException e) {
    // shouldn't happen...
    return Collections.emptyList();
  }
}
origin: org.apache.chemistry.opencmis/chemistry-opencmis-server-bindings

/**
 * Generates a valid Atom id.
 */
public String generateAtomId(String input) {
  if (input == null) {
    return ID_DUMMY;
  }
  return ID_PREFIX + Base64.encodeBytes(IOUtils.toUTF8Bytes(input));
}
origin: org.apache.chemistry.opencmis/chemistry-opencmis-server-bindings

/**
 * Transforms the transaction into a cookie name.
 */
public String getCookieName(String token) {
  if (token == null || token.length() == 0) {
    return "cmis%";
  }
  return "cmis_" + Base64.encodeBytes(IOUtils.toUTF8Bytes(token)).replace('=', '%');
}
origin: org.apache.chemistry.opencmis/chemistry-opencmis-commons-impl

  encoded = encodeBytes(source, off, len, NO_OPTIONS);
} catch (java.io.IOException ex) {
  assert false : ex.getMessage();
origin: org.apache.chemistry.opencmis/chemistry-opencmis-android-client

  encoded = encodeBytes(source, off, len, NO_OPTIONS);
} catch (java.io.IOException ex) {
  assert false : ex.getMessage();
origin: org.apache.chemistry.opencmis/chemistry-opencmis-android-client

/**
 * Creates a basic authentication header value from a username and a
 * password.
 */
protected List<String> createBasicAuthHeaderValue(String username, String password) {
  if (password == null) {
    password = "";
  }
  Object charset = getSession().get(SessionParameter.AUTH_HTTP_BASIC_CHARSET);
  if (charset instanceof String) {
    charset = ((String) charset).trim();
  } else {
    charset = IOUtils.UTF8;
  }
  byte[] usernamePassword;
  try {
    usernamePassword = (username + ":" + password).getBytes((String) charset);
  } catch (UnsupportedEncodingException e) {
    throw new CmisRuntimeException("Unsupported encoding '" + charset + "'!", e);
  }
  return Collections.singletonList("Basic " + Base64.encodeBytes(usernamePassword));
}
origin: org.apache.chemistry.opencmis/chemistry-opencmis-client-bindings

/**
 * Creates a basic authentication header value from a username and a
 * password.
 */
protected List<String> createBasicAuthHeaderValue(String username, String password) {
  if (password == null) {
    password = "";
  }
  Object charset = getSession().get(SessionParameter.AUTH_HTTP_BASIC_CHARSET);
  if (charset instanceof String) {
    charset = ((String) charset).trim();
  } else {
    charset = IOUtils.UTF8;
  }
  byte[] usernamePassword;
  try {
    usernamePassword = (username + ":" + password).getBytes((String) charset);
  } catch (UnsupportedEncodingException e) {
    throw new CmisRuntimeException("Unsupported encoding '" + charset + "'!", e);
  }
  return Collections.singletonList("Basic " + Base64.encodeBytes(usernamePassword));
}
origin: org.apache.chemistry.opencmis/chemistry-opencmis-client-bindings

return Base64.encodeBytes(token);
org.apache.chemistry.opencmis.commons.implBase64encodeBytes

Javadoc

Encodes a byte array into Base64 notation. Does not GZip-compress data.

Popular methods of Base64

  • 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
  • encodeFromFile
    Convenience method for reading a binary file and base64-encoding it. As of v 2.3, if there is a erro
  • 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

  • Creating JSON documents from java classes using gson
  • getSupportFragmentManager (FragmentActivity)
  • getResourceAsStream (ClassLoader)
  • runOnUiThread (Activity)
  • BufferedWriter (java.io)
    Wraps an existing Writer and buffers the output. Expensive interaction with the underlying reader is
  • MessageFormat (java.text)
    Produces concatenated messages in language-neutral way. New code should probably use java.util.Forma
  • Arrays (java.util)
    This class contains various methods for manipulating arrays (such as sorting and searching). This cl
  • Collections (java.util)
    This class consists exclusively of static methods that operate on or return collections. It contains
  • BlockingQueue (java.util.concurrent)
    A java.util.Queue that additionally supports operations that wait for the queue to become non-empty
  • ConcurrentHashMap (java.util.concurrent)
    A plug-in replacement for JDK1.5 java.util.concurrent.ConcurrentHashMap. This version is based on or
  • CodeWhisperer alternatives
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