Class CompressorProvider.TileCompressorControl
java.lang.Object
nom.tam.fits.compression.provider.CompressorProvider.TileCompressorControl
- All Implemented Interfaces:
ICompressorControl
- Enclosing class:
CompressorProvider
protected static class CompressorProvider.TileCompressorControl
extends Object
implements ICompressorControl
private implementation of the tile compression provider, all is based on
the option based constructor of the compressors.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Constructor
<ICompressor<Buffer>> private final Class
<? extends ICompressOption> private final Constructor
<ICompressParameters> -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
TileCompressorControl
(Class<?> compressorClass) protected
TileCompressorControl
(Class<?> compressorClass, Class<?> parametersClass) -
Method Summary
Modifier and TypeMethodDescriptionboolean
compress
(Buffer in, ByteBuffer out, ICompressOption option) Compress the buffer into the byte buffer using the specified options.void
decompress
(ByteBuffer in, Buffer out, ICompressOption option) decompress the byte buffer back into the buffer using the specified options.private ICompressor
<Buffer> newCompressor
(ICompressOption option) option()
-
Field Details
-
constructor
-
optionClass
-
parametersConstructor
-
-
Constructor Details
-
TileCompressorControl
-
TileCompressorControl
-
-
Method Details
-
compress
Description copied from interface:ICompressorControl
Compress the buffer into the byte buffer using the specified options.- Specified by:
compress
in interfaceICompressorControl
- Parameters:
in
- the buffer to compress.out
- the compressed data to fill (must already be allocated with enough space)option
- the options to use for the compression- Returns:
- true if the compression succeded.
-
decompress
Description copied from interface:ICompressorControl
decompress the byte buffer back into the buffer using the specified options.- Specified by:
decompress
in interfaceICompressorControl
- Parameters:
in
- the bytes to decompress.out
- the buffer to fill with the decompressed data (must already be allocated with enough space)option
- the options to use for decompressing.
-
option
- Specified by:
option
in interfaceICompressorControl
- Returns:
- a option instance that can be used to control the compression meganism.
-
newCompressor
private ICompressor<Buffer> newCompressor(ICompressOption option) throws InstantiationException, IllegalAccessException, InvocationTargetException
-