Package org.pgpainless.algorithm
Enum Class StreamEncoding
- All Implemented Interfaces:
Serializable
,Comparable<StreamEncoding>
,Constable
Enumeration of possible encoding formats of the content of the literal data packet.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionThe Literal packet contains binary data.Deprecated.The Literal packet contains text data, and thus may need line ends converted to local form, or other text-mode changes.Indication that the implementation believes that the literal data contains UTF-8 text. -
Method Summary
Modifier and TypeMethodDescriptionstatic StreamEncoding
fromCode
(int code) Return theStreamEncoding
corresponding to the provided code identifier.char
getCode()
Return the code identifier of the encoding.static StreamEncoding
requireFromCode
(int code) Return theStreamEncoding
corresponding to the provided code identifier.static StreamEncoding
Returns the enum constant of this class with the specified name.static StreamEncoding[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
BINARY
The Literal packet contains binary data. -
TEXT
The Literal packet contains text data, and thus may need line ends converted to local form, or other text-mode changes. -
UTF8
Indication that the implementation believes that the literal data contains UTF-8 text. -
LOCAL
Deprecated.Early versions of PGP also defined a value of 'l' as a 'local' mode for machine-local conversions. RFC 1991 [RFC1991] incorrectly stated this local mode flag as '1' (ASCII numeral one). Both of these local modes are deprecated.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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:
IllegalArgumentException
- if this enum class has no constant with the specified nameNullPointerException
- if the argument is null
-
getCode
public char getCode()Return the code identifier of the encoding.- Returns:
- identifier
-
fromCode
Return theStreamEncoding
corresponding to the provided code identifier. If no matching encoding is found, return null.- Parameters:
code
- identifier- Returns:
- encoding enum
-
requireFromCode
Return theStreamEncoding
corresponding to the provided code identifier. If no matching encoding is found, throw aNoSuchElementException
.- Parameters:
code
- identifier- Returns:
- encoding enum
- Throws:
NoSuchElementException
- in case of an unmatched identifier
-