1 // -*- Mode: Java; indent-tabs-mode: t; tab-width: 4 -*-
2 // ---------------------------------------------------------------------------
4 // Copyright (C) Stephanie Gawroriski <xer@multiphasicapps.net>
5 // ---------------------------------------------------------------------------
6 // SquirrelJME is under the GNU General Public License v3+, or later.
7 // See license.mkd for licensing and copyright information.
8 // ---------------------------------------------------------------------------
10 package cc
.squirreljme
.plugin
.util
;
13 * This represents the alphabet that is used for Base64.
17 public enum Base64Alphabet
19 /** The basic and MIME alphabet. */
20 BASIC('A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M',
21 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z',
22 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm',
23 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z',
24 '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '+', '/', '='),
26 /** The URL alphabet. */
27 URL('A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M',
28 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z',
29 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm',
30 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z',
31 '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '-', '_', '='),
36 /** The alphabet for the characters. */
37 final char[] _alphabet
;
40 * Initializes the alphabet.
42 * @param __alphabet The alphabet.
43 * @throws NullPointerException On null arguments.
46 Base64Alphabet(char... __alphabet
)
47 throws NullPointerException
49 if (__alphabet
== null)
50 throw new NullPointerException("NARG");
52 this._alphabet
= __alphabet
;