com.amazonaws.util
Enum Base32

java.lang.Object
  extended by java.lang.Enum<Base32>
      extended by com.amazonaws.util.Base32
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<Base32>

public enum Base32
extends java.lang.Enum<Base32>

A Base 32 codec API. See http://www.ietf.org/rfc/rfc4648.txt

Author:
Hanson Char

Method Summary
static byte[] decode(byte[] b32)
          Decodes the given base 32 encoded bytes.
static byte[] decode(java.lang.String b32)
          Decodes the given base 32 encoded string, skipping carriage returns, line feeds and spaces as needed.
static byte[] encode(byte[] bytes)
          Returns a 32 encoded byte array of the given bytes.
static java.lang.String encodeAsString(byte... bytes)
          Returns a base 32 encoded string of the given bytes.
static Base32 valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static Base32[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
compareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Method Detail

values

public static Base32[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (Base32 c : Base32.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static Base32 valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
java.lang.NullPointerException - if the argument is null

encodeAsString

public static java.lang.String encodeAsString(byte... bytes)
Returns a base 32 encoded string of the given bytes.


encode

public static byte[] encode(byte[] bytes)
Returns a 32 encoded byte array of the given bytes. hchar: compared to Base32.encode(byte[]) of JakartaCommons-1.5, this routine is > 20x faster on my MacAir.


decode

public static byte[] decode(java.lang.String b32)
Decodes the given base 32 encoded string, skipping carriage returns, line feeds and spaces as needed. hchar: compared to Base32.decode(String) of JakartaCommons-1.5, this routine is > 11x faster on my MacAir.


decode

public static byte[] decode(byte[] b32)
Decodes the given base 32 encoded bytes.



Copyright © 2010 Amazon Web Services, Inc. All Rights Reserved.