- java.lang.Object
-
- com.pervasive.datarush.io.compression.UncompressedData
-
- All Implemented Interfaces:
CompressionFormat,Serializable
public class UncompressedData extends Object implements CompressionFormat
Defines support for uncompressed data.- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from interface com.pervasive.datarush.io.compression.CompressionFormat
NONE
-
-
Constructor Summary
Constructors Constructor Description UncompressedData()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description OutputStreamcompressStream(OutputStream out)Wraps the specified stream in a compressor for the format.SplitInputStreamdecompressSplitStream(DataSplit split, InputStream in, int bufferSize)Wraps the specified stream for a split in a decompressor for the format.InputStreamdecompressStream(InputStream in)Wraps the specified stream in a decompressor for the format.booleanequals(Object o)StringgetCompressedFilename(String fileName)Adds the common file suffix associated with this format to the given file name.StringgetName()Gets the name of the compression algorithm.SplitIteratorgetSplitIterator(FileClient client, Path filePath, SplitOptions options)Create aSplitIteratorfor the given file path and options.StringgetUncompressedFilename(String fileName)Strips any file suffix associated with this format from the given file name.inthashCode()booleanisCompressedFilename(String fileName)Indicates whether the specified file name is compressed in this format.booleanisSplittable()Indicates whether compressed data files may be split.
-
-
-
Method Detail
-
getName
public String getName()
Description copied from interface:CompressionFormatGets the name of the compression algorithm.- Specified by:
getNamein interfaceCompressionFormat- Returns:
- the well-known name of the compression format
-
isSplittable
public boolean isSplittable()
Description copied from interface:CompressionFormatIndicates whether compressed data files may be split. Generally, compressed data cannot be split.- Specified by:
isSplittablein interfaceCompressionFormat- Returns:
trueif the compression format allow file splits,falseotherwise.
-
isCompressedFilename
public boolean isCompressedFilename(String fileName)
Description copied from interface:CompressionFormatIndicates whether the specified file name is compressed in this format. Generally, this is done by looking at the file suffix.- Specified by:
isCompressedFilenamein interfaceCompressionFormat- Parameters:
fileName- the file name to check- Returns:
trueif the file is believed to be compressed in this format,falseotherwise.
-
getUncompressedFilename
public String getUncompressedFilename(String fileName)
Description copied from interface:CompressionFormatStrips any file suffix associated with this format from the given file name.- Specified by:
getUncompressedFilenamein interfaceCompressionFormat- Parameters:
fileName- the file name to process- Returns:
- the expected name of the uncompressed file
-
getCompressedFilename
public String getCompressedFilename(String fileName)
Description copied from interface:CompressionFormatAdds the common file suffix associated with this format to the given file name.- Specified by:
getCompressedFilenamein interfaceCompressionFormat- Parameters:
fileName- the file name to process- Returns:
- the expected name of the compressed file
-
decompressStream
public InputStream decompressStream(InputStream in) throws IOException
Description copied from interface:CompressionFormatWraps the specified stream in a decompressor for the format.- Specified by:
decompressStreamin interfaceCompressionFormat- Parameters:
in- the compressed byte stream to decompress- Returns:
- the uncompressed data stream
- Throws:
IOException- if an I/O error occurs
-
compressStream
public OutputStream compressStream(OutputStream out) throws IOException
Description copied from interface:CompressionFormatWraps the specified stream in a compressor for the format.- Specified by:
compressStreamin interfaceCompressionFormat- Parameters:
out- the uncompressed byte stream to compress- Returns:
- the compressed data stream
- Throws:
IOException- if an I/O error occurs
-
getSplitIterator
public SplitIterator getSplitIterator(FileClient client, Path filePath, SplitOptions options) throws IOException
Description copied from interface:CompressionFormatCreate aSplitIteratorfor the given file path and options. Iterators may vary based on the compression format of an input data stream or if the input is not compressed. For instance, compression formats that do not support splitting will create an iterator with a single split: the whole file.- Specified by:
getSplitIteratorin interfaceCompressionFormat- Parameters:
client- the file client in usefilePath- path to the input fileoptions- splitting options- Returns:
- an iterator of the split(s) for the input file
- Throws:
IOException- if an I/O error occurs
-
decompressSplitStream
public SplitInputStream decompressSplitStream(DataSplit split, InputStream in, int bufferSize) throws IOException
Description copied from interface:CompressionFormatWraps the specified stream for a split in a decompressor for the format. The format must be splittable or anUnsupportedOperationExceptionwill be thrown.- Specified by:
decompressSplitStreamin interfaceCompressionFormat- Parameters:
split- split being read and decompressedin- the compressed byte stream for a split to decompress- Returns:
- the uncompressed data stream
- Throws:
IOException- if an I/O error occurs
-
-