Package lazyj

Class Utils.Base64Coder

java.lang.Object
java.util.prefs.Preferences
java.util.prefs.AbstractPreferences
lazyj.Utils.Base64Coder
Enclosing class:
Utils

public static class Utils.Base64Coder
extends java.util.prefs.AbstractPreferences
Since:
Nov 6, 2010
Author:
costing (original code from a Sun forum thread that was removed in the mean time)
  • Field Summary

    Fields inherited from class java.util.prefs.AbstractPreferences

    lock, newNode

    Fields inherited from class java.util.prefs.Preferences

    MAX_KEY_LENGTH, MAX_NAME_LENGTH, MAX_VALUE_LENGTH
  • Method Summary

    Modifier and Type Method Description
    protected java.lang.String[] childrenNamesSpi()  
    protected java.util.prefs.AbstractPreferences childSpi​(java.lang.String name)  
    static byte[] decode​(java.lang.String base64String)
    Given a String containing a Base64 representation, return the corresponding byte array.
    static java.lang.String encode​(byte[] b)
    Given a byte array, return its Base64 representation as a String.
    protected void flushSpi()  
    java.lang.String get​(java.lang.String key, java.lang.String def)  
    protected java.lang.String getSpi​(java.lang.String key)  
    protected java.lang.String[] keysSpi()  
    void put​(java.lang.String key, java.lang.String value)  
    protected void putSpi​(java.lang.String key, java.lang.String value)  
    protected void removeNodeSpi()  
    protected void removeSpi​(java.lang.String key)  
    protected void syncSpi()  

    Methods inherited from class java.util.prefs.AbstractPreferences

    absolutePath, addNodeChangeListener, addPreferenceChangeListener, cachedChildren, childrenNames, clear, exportNode, exportSubtree, flush, getBoolean, getByteArray, getChild, getDouble, getFloat, getInt, getLong, isRemoved, isUserNode, keys, name, node, nodeExists, parent, putBoolean, putByteArray, putDouble, putFloat, putInt, putLong, remove, removeNode, removeNodeChangeListener, removePreferenceChangeListener, sync, toString

    Methods inherited from class java.util.prefs.Preferences

    importPreferences, systemNodeForPackage, systemRoot, userNodeForPackage, userRoot

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Method Details

    • encode

      public static java.lang.String encode​(byte[] b)
      Given a byte array, return its Base64 representation as a String.
      Parameters:
      b -
      Returns:
      encoded bytes
    • decode

      public static byte[] decode​(java.lang.String base64String)
      Given a String containing a Base64 representation, return the corresponding byte array.
      Parameters:
      base64String -
      Returns:
      decoded bytes
    • get

      public java.lang.String get​(java.lang.String key, java.lang.String def)
      Overrides:
      get in class java.util.prefs.AbstractPreferences
    • put

      public void put​(java.lang.String key, java.lang.String value)
      Overrides:
      put in class java.util.prefs.AbstractPreferences
    • childSpi

      protected java.util.prefs.AbstractPreferences childSpi​(java.lang.String name)
      Specified by:
      childSpi in class java.util.prefs.AbstractPreferences
    • putSpi

      protected void putSpi​(java.lang.String key, java.lang.String value)
      Specified by:
      putSpi in class java.util.prefs.AbstractPreferences
    • getSpi

      protected java.lang.String getSpi​(java.lang.String key)
      Specified by:
      getSpi in class java.util.prefs.AbstractPreferences
    • removeSpi

      protected void removeSpi​(java.lang.String key)
      Specified by:
      removeSpi in class java.util.prefs.AbstractPreferences
    • keysSpi

      protected java.lang.String[] keysSpi() throws java.util.prefs.BackingStoreException
      Specified by:
      keysSpi in class java.util.prefs.AbstractPreferences
      Throws:
      java.util.prefs.BackingStoreException
    • childrenNamesSpi

      protected java.lang.String[] childrenNamesSpi() throws java.util.prefs.BackingStoreException
      Specified by:
      childrenNamesSpi in class java.util.prefs.AbstractPreferences
      Throws:
      java.util.prefs.BackingStoreException
    • syncSpi

      protected void syncSpi() throws java.util.prefs.BackingStoreException
      Specified by:
      syncSpi in class java.util.prefs.AbstractPreferences
      Throws:
      java.util.prefs.BackingStoreException
    • removeNodeSpi

      protected void removeNodeSpi() throws java.util.prefs.BackingStoreException
      Specified by:
      removeNodeSpi in class java.util.prefs.AbstractPreferences
      Throws:
      java.util.prefs.BackingStoreException
    • flushSpi

      protected void flushSpi() throws java.util.prefs.BackingStoreException
      Specified by:
      flushSpi in class java.util.prefs.AbstractPreferences
      Throws:
      java.util.prefs.BackingStoreException