Package org.pgpainless.algorithm

# Enum Class StreamEncoding

java.lang.Object
java.lang.Enum<StreamEncoding>
org.pgpainless.algorithm.StreamEncoding

All Implemented Interfaces:
  `Serializable`, `Comparable<StreamEncoding>`, `Constable`

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

## Nested Class Summary

## Nested classes/interfaces inherited from class java.lang.Enum

`Enum.EnumDesc<E extends Enum<E>>`

## 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

Modifier and Type
Method
Description
`static StreamEncoding`
`fromCode(int code)`
Return the `StreamEncoding` corresponding to the provided code identifier.
`char`
`getCode()`
Return the code identifier of the encoding.
`static StreamEncoding`
`requireFromCode(int code)`
Return the `StreamEncoding` corresponding to the provided code identifier.
`static StreamEncoding`
`valueOf(String name)`
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.

### Methods inherited from class java.lang.Enum

`clone, compareTo, describeConstable, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf`

### Methods inherited from class java.lang.Object

`getClass, notify, notifyAll, wait, wait, wait`

## Enum Constant Details

### 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 Details

### values

public static StreamEncoding[] 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

public static StreamEncoding valueOf(String name)
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 name
  `NullPointerException` - if the argument is null

### getCode

public char getCode()
Return the code identifier of the encoding.

Returns:
  identifier

### fromCode

@Nullable public static StreamEncoding fromCode(int code)
Return the `StreamEncoding` corresponding to the provided code identifier. If no matching encoding is found, return null.

Parameters:
  `code` - identifier
Returns:
  encoding enum

### requireFromCode

@Nonnull public static StreamEncoding requireFromCode(int code)
Return the `StreamEncoding` corresponding to the provided code identifier. If no matching encoding is found, throw a `NoSuchElementException`.

Parameters:
  `code` - identifier
Returns:
  encoding enum
Throws:
  `NoSuchElementException` - in case of an unmatched identifier