Package com.helger.phase4.attachment
Enum EAS4CompressionMode
- All Implemented Interfaces:
com.helger.commons.id.IHasID<String>,Serializable,Comparable<EAS4CompressionMode>,java.lang.constant.Constable
public enum EAS4CompressionMode
extends Enum<EAS4CompressionMode>
implements com.helger.commons.id.IHasID<String>
Defines the allowed AS4 compression modes.
- Author:
- Philip Helger
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum Constants -
Method Summary
Modifier and TypeMethodDescriptionabstract OutputStreamGet anOutputStreamto compress the providedOutputStream.abstract InputStreamGet anInputStreamto decompress the providedInputStream.static EAS4CompressionModegetFromIDOrNull(String sID) static EAS4CompressionModegetFromMimeTypeStringOrNull(String sMimeType) getID()com.helger.commons.mime.IMimeTypestatic EAS4CompressionModeReturns the enum constant of this type with the specified name.static EAS4CompressionMode[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
GZIP
GZip compression mode
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
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
-
getID
- Specified by:
getIDin interfacecom.helger.commons.id.IHasID<String>
-
getMimeType
- Returns:
- The MIME type of the compression mode. Never
null.
-
getMimeTypeAsString
- Returns:
- The string representation of the MIME type of the compression mode.
Never
null.
-
getFileExtension
- Returns:
- The file extension including the leading dot (e.g. ".gz")
-
getDecompressStream
@Nonnull public abstract InputStream getDecompressStream(@Nonnull InputStream aIS) throws IOException Get anInputStreamto decompress the providedInputStream.- Parameters:
aIS- The sourceInputStream. May not benull.- Returns:
- The decompressing
InputStream - Throws:
IOException- In case of IO error
-
getCompressStream
@Nonnull public abstract OutputStream getCompressStream(@Nonnull OutputStream aOS) throws IOException Get anOutputStreamto compress the providedOutputStream.- Parameters:
aOS- The sourceOutputStream. May not benull.- Returns:
- The compressing
OutputStream - Throws:
IOException- In case of IO error
-
getFromMimeTypeStringOrNull
-
getFromIDOrNull
-