Top Description Fields Constructors Methods
org.codehaus.stax2.typed

public final Class Base64Variants

extends Object
Class Inheritance

This class is used as a container for commonly used Base64 variants.
Author
Tatu Saloranta
Since
3.0.0

Field Summary

Modifier and TypeField and Description
public static final Base64Variant
MIME

This variant is what most people would think of "the standard" Base64 encoding.

public static final Base64Variant
MIME_NO_LINEFEEDS

Slightly non-standard modification of MIME which does not use linefeeds (max line length set to infinite).

public static final Base64Variant
MODIFIED_FOR_URL

This non-standard variant is usually used when encoded data needs to be passed via URLs (such as part of GET request).

public static final Base64Variant
PEM

This variant is the one that predates MIME: it is otherwise identical, except that it mandates shorter line length.

pack-priv static final String

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public static Base64Variant
getDefaultVariant()

Method used to get the default variant ("MIME") for cases where caller does not explicitly specify the variant

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

MIMEback to summary
public static final Base64Variant MIME

This variant is what most people would think of "the standard" Base64 encoding.

See wikipedia Base64 entry for details.

MIME_NO_LINEFEEDSback to summary
public static final Base64Variant MIME_NO_LINEFEEDS

Slightly non-standard modification of MIME which does not use linefeeds (max line length set to infinite). Useful when linefeeds wouldn't work well (possibly in attributes), or for minor space savings (save 1 linefeed per 76 data chars, ie. ~1.4% savings).

MODIFIED_FOR_URLback to summary
public static final Base64Variant MODIFIED_FOR_URL

This non-standard variant is usually used when encoded data needs to be passed via URLs (such as part of GET request). It differs from the base MIME variant in multiple ways. First, no padding is used: this also means that it generally can not be written in multiple separate but adjacent chunks (which would not be the usual use case in any case). Also, no linefeeds are used (max line length set to infinite). And finally, two characters (plus and slash) that would need quoting in URLs are replaced with more optimal alternatives (hyphen and underscore, respectively).

PEMback to summary
public static final Base64Variant PEM

This variant is the one that predates MIME: it is otherwise identical, except that it mandates shorter line length.

STD_BASE64_ALPHABETback to summary
pack-priv static final String STD_BASE64_ALPHABET

Constructor Detail

Base64Variantsback to summary
public Base64Variants()

Method Detail

getDefaultVariantback to summary
public static Base64Variant getDefaultVariant()

Method used to get the default variant ("MIME") for cases where caller does not explicitly specify the variant