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
-
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
-
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 classjava.util.prefs.AbstractPreferences
-
put
public void put(java.lang.String key, java.lang.String value)- Overrides:
put
in classjava.util.prefs.AbstractPreferences
-
childSpi
protected java.util.prefs.AbstractPreferences childSpi(java.lang.String name)- Specified by:
childSpi
in classjava.util.prefs.AbstractPreferences
-
putSpi
protected void putSpi(java.lang.String key, java.lang.String value)- Specified by:
putSpi
in classjava.util.prefs.AbstractPreferences
-
getSpi
protected java.lang.String getSpi(java.lang.String key)- Specified by:
getSpi
in classjava.util.prefs.AbstractPreferences
-
removeSpi
protected void removeSpi(java.lang.String key)- Specified by:
removeSpi
in classjava.util.prefs.AbstractPreferences
-
keysSpi
protected java.lang.String[] keysSpi() throws java.util.prefs.BackingStoreException- Specified by:
keysSpi
in classjava.util.prefs.AbstractPreferences
- Throws:
java.util.prefs.BackingStoreException
-
childrenNamesSpi
protected java.lang.String[] childrenNamesSpi() throws java.util.prefs.BackingStoreException- Specified by:
childrenNamesSpi
in classjava.util.prefs.AbstractPreferences
- Throws:
java.util.prefs.BackingStoreException
-
syncSpi
protected void syncSpi() throws java.util.prefs.BackingStoreException- Specified by:
syncSpi
in classjava.util.prefs.AbstractPreferences
- Throws:
java.util.prefs.BackingStoreException
-
removeNodeSpi
protected void removeNodeSpi() throws java.util.prefs.BackingStoreException- Specified by:
removeNodeSpi
in classjava.util.prefs.AbstractPreferences
- Throws:
java.util.prefs.BackingStoreException
-
flushSpi
protected void flushSpi() throws java.util.prefs.BackingStoreException- Specified by:
flushSpi
in classjava.util.prefs.AbstractPreferences
- Throws:
java.util.prefs.BackingStoreException
-