|
@@ -49,37 +49,37 @@ public class Base64
|
|
/* P U B L I C F I E L D S */
|
|
/* P U B L I C F I E L D S */
|
|
|
|
|
|
/** No options specified. Value is zero. */
|
|
/** No options specified. Value is zero. */
|
|
- public final static int NO_OPTIONS = 0;
|
|
|
|
|
|
+ public static final int NO_OPTIONS = 0;
|
|
|
|
|
|
/** Specify encoding. */
|
|
/** Specify encoding. */
|
|
- public final static int ENCODE = 1;
|
|
|
|
|
|
+ public static final int ENCODE = 1;
|
|
|
|
|
|
/** Specify decoding. */
|
|
/** Specify decoding. */
|
|
- public final static int DECODE = 0;
|
|
|
|
|
|
+ public static final int DECODE = 0;
|
|
|
|
|
|
/** Specify that data should be gzip-compressed. */
|
|
/** Specify that data should be gzip-compressed. */
|
|
- public final static int GZIP = 2;
|
|
|
|
|
|
+ public static final int GZIP = 2;
|
|
|
|
|
|
/** Don't break lines when encoding (violates strict Base64 specification) */
|
|
/** Don't break lines when encoding (violates strict Base64 specification) */
|
|
- public final static int DONT_BREAK_LINES = 8;
|
|
|
|
|
|
+ public static final int DONT_BREAK_LINES = 8;
|
|
|
|
|
|
/* P R I V A T E F I E L D S */
|
|
/* P R I V A T E F I E L D S */
|
|
|
|
|
|
/** Maximum line length (76) of Base64 output. */
|
|
/** Maximum line length (76) of Base64 output. */
|
|
- private final static int MAX_LINE_LENGTH = 76;
|
|
|
|
|
|
+ private static final int MAX_LINE_LENGTH = 76;
|
|
|
|
|
|
/** The equals sign (=) as a byte. */
|
|
/** The equals sign (=) as a byte. */
|
|
- private final static byte EQUALS_SIGN = (byte) '=';
|
|
|
|
|
|
+ private static final byte EQUALS_SIGN = (byte) '=';
|
|
|
|
|
|
/** The new line character (\n) as a byte. */
|
|
/** The new line character (\n) as a byte. */
|
|
- private final static byte NEW_LINE = (byte) '\n';
|
|
|
|
|
|
+ private static final byte NEW_LINE = (byte) '\n';
|
|
|
|
|
|
/** Preferred encoding. */
|
|
/** Preferred encoding. */
|
|
- private final static String PREFERRED_ENCODING = "UTF-8";
|
|
|
|
|
|
+ private static final String PREFERRED_ENCODING = "UTF-8";
|
|
|
|
|
|
/** The 64 valid Base64 values. */
|
|
/** The 64 valid Base64 values. */
|
|
- private final static byte[] ALPHABET;
|
|
|
|
- private final static byte[] _NATIVE_ALPHABET = /* May be something funny like EBCDIC */
|
|
|
|
|
|
+ private static final byte[] ALPHABET;
|
|
|
|
+ private static final byte[] _NATIVE_ALPHABET = /* May be something funny like EBCDIC */
|
|
{ (byte) 'A', (byte) 'B', (byte) 'C', (byte) 'D', (byte) 'E', (byte) 'F', (byte) 'G',
|
|
{ (byte) 'A', (byte) 'B', (byte) 'C', (byte) 'D', (byte) 'E', (byte) 'F', (byte) 'G',
|
|
(byte) 'H', (byte) 'I', (byte) 'J', (byte) 'K', (byte) 'L', (byte) 'M', (byte) 'N',
|
|
(byte) 'H', (byte) 'I', (byte) 'J', (byte) 'K', (byte) 'L', (byte) 'M', (byte) 'N',
|
|
(byte) 'O', (byte) 'P', (byte) 'Q', (byte) 'R', (byte) 'S', (byte) 'T', (byte) 'U',
|
|
(byte) 'O', (byte) 'P', (byte) 'Q', (byte) 'R', (byte) 'S', (byte) 'T', (byte) 'U',
|
|
@@ -121,7 +121,7 @@ public class Base64
|
|
* Translates a Base64 value to either its 6-bit reconstruction value or a
|
|
* Translates a Base64 value to either its 6-bit reconstruction value or a
|
|
* negative number indicating some other meaning.
|
|
* negative number indicating some other meaning.
|
|
**/
|
|
**/
|
|
- final static byte[] DECODABET = { -9, -9, -9, -9, -9, -9, -9, -9, -9, // Decimal 0 - 8
|
|
|
|
|
|
+ static final byte[] DECODABET = { -9, -9, -9, -9, -9, -9, -9, -9, -9, // Decimal 0 - 8
|
|
-5, -5, // Whitespace: Tab and Linefeed
|
|
-5, -5, // Whitespace: Tab and Linefeed
|
|
-9, -9, // Decimal 11 - 12
|
|
-9, -9, // Decimal 11 - 12
|
|
-5, // Whitespace: Carriage Return
|
|
-5, // Whitespace: Carriage Return
|
|
@@ -156,9 +156,9 @@ public class Base64
|
|
*/
|
|
*/
|
|
};
|
|
};
|
|
|
|
|
|
- // private final static byte BAD_ENCODING = -9; // Indicates error in encoding
|
|
|
|
- private final static byte WHITE_SPACE_ENC = -5; // Indicates white space in encoding
|
|
|
|
- private final static byte EQUALS_SIGN_ENC = -1; // Indicates equals sign in encoding
|
|
|
|
|
|
+ // private static final byte BAD_ENCODING = -9; // Indicates error in encoding
|
|
|
|
+ private static final byte WHITE_SPACE_ENC = -5; // Indicates white space in encoding
|
|
|
|
+ private static final byte EQUALS_SIGN_ENC = -1; // Indicates equals sign in encoding
|
|
|
|
|
|
/** Defeats instantiation. */
|
|
/** Defeats instantiation. */
|
|
private Base64()
|
|
private Base64()
|