public enum Compression extends java.lang.Enum<Compression>
Enum Constant and Description |
---|
AUTO
When reading a file, automatically determine the compression type based on filename extension.
|
BZIP2
BZip compression.
|
DEFLATE
Deflate compression.
|
GZIP
GZip compression.
|
UNCOMPRESSED
No compression.
|
ZIP
Zip compression.
|
ZSTD
ZStandard compression.
|
Modifier and Type | Method and Description |
---|---|
static Compression |
detect(java.lang.String filename) |
java.lang.String |
getSuggestedSuffix() |
boolean |
isCompressed(java.lang.String filename) |
boolean |
matches(java.lang.String filename) |
abstract java.nio.channels.ReadableByteChannel |
readDecompressed(java.nio.channels.ReadableByteChannel channel) |
static Compression |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.
|
static Compression[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
abstract java.nio.channels.WritableByteChannel |
writeCompressed(java.nio.channels.WritableByteChannel channel) |
public static final Compression AUTO
public static final Compression UNCOMPRESSED
public static final Compression GZIP
public static final Compression BZIP2
public static final Compression ZIP
public static final Compression ZSTD
The .zst
extension is specified in RFC
8478.
The Beam Java SDK does not pull in the Zstd library by default, so it is the user's
responsibility to declare an explicit dependency on zstd-jni
. Attempts to read or write
.zst files without zstd-jni
loaded will result in NoClassDefFoundError
at
runtime.
public static final Compression DEFLATE
public static Compression[] values()
for (Compression c : Compression.values()) System.out.println(c);
public static Compression valueOf(java.lang.String name)
name
- the name of the enum constant to be returned.java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is nullpublic java.lang.String getSuggestedSuffix()
public boolean matches(java.lang.String filename)
public boolean isCompressed(java.lang.String filename)
public static Compression detect(java.lang.String filename)
public abstract java.nio.channels.ReadableByteChannel readDecompressed(java.nio.channels.ReadableByteChannel channel) throws java.io.IOException
java.io.IOException
public abstract java.nio.channels.WritableByteChannel writeCompressed(java.nio.channels.WritableByteChannel channel) throws java.io.IOException
java.io.IOException