Package org.pgpainless.algorithm
Enum StreamEncoding
- java.lang.Object
-
- java.lang.Enum<StreamEncoding>
-
- org.pgpainless.algorithm.StreamEncoding
-
- All Implemented Interfaces:
Serializable
,Comparable<StreamEncoding>
public enum StreamEncoding extends Enum<StreamEncoding>
Enumeration of possible encoding formats of the content of the literal data packet.- See Also:
- RFC4880: Literal Data Packet
-
-
Enum Constant Summary
Enum Constants Enum Constant Description BINARY
The Literal packet contains binary data.LOCAL
Deprecated.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.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static StreamEncoding
fromCode(int code)
Return theStreamEncoding
corresponding to the provided code identifier.char
getCode()
Return the code identifier of the encoding.static StreamEncoding
valueOf(String name)
Returns the enum constant of this type with the specified name.static StreamEncoding[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
BINARY
public static final StreamEncoding BINARY
The Literal packet contains binary data.
-
TEXT
public static final StreamEncoding TEXT
The Literal packet contains text data, and thus may need line ends converted to local form, or other text-mode changes.
-
UTF8
public static final StreamEncoding UTF8
Indication that the implementation believes that the literal data contains UTF-8 text.
-
LOCAL
@Deprecated public static final StreamEncoding 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 Detail
-
values
public static StreamEncoding[] 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 (StreamEncoding c : StreamEncoding.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static StreamEncoding valueOf(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:
IllegalArgumentException
- if this enum type 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
public static StreamEncoding fromCode(int code)
Return theStreamEncoding
corresponding to the provided code identifier.- Parameters:
code
- identifier- Returns:
- encoding enum
-
-