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 java.lang.Object implements ICompressorControl
private implementation of the tile compression provider, all is based on the option based constructor of the compressors.
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.reflect.Constructor<ICompressor<java.nio.Buffer>>constructorprivate java.lang.Class<? extends ICompressOption>optionClassprivate java.lang.reflect.Constructor<ICompressParameters>parametersConstructor
-
Constructor Summary
Constructors Modifier Constructor Description protectedTileCompressorControl(java.lang.Class<?> compressorClass)protectedTileCompressorControl(java.lang.Class<?> compressorClass, java.lang.Class<?> parametersClass)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancompress(java.nio.Buffer in, java.nio.ByteBuffer out, ICompressOption option)Compress the buffer into the byte buffer using the specified options.voiddecompress(java.nio.ByteBuffer in, java.nio.Buffer out, ICompressOption option)decompress the byte buffer back into the buffer using the specified options.private ICompressor<java.nio.Buffer>newCompressor(ICompressOption option)ICompressOptionoption()
-
-
-
Field Detail
-
constructor
private final java.lang.reflect.Constructor<ICompressor<java.nio.Buffer>> constructor
-
optionClass
private final java.lang.Class<? extends ICompressOption> optionClass
-
parametersConstructor
private final java.lang.reflect.Constructor<ICompressParameters> parametersConstructor
-
-
Method Detail
-
compress
public boolean compress(java.nio.Buffer in, java.nio.ByteBuffer out, ICompressOption option)Description copied from interface:ICompressorControlCompress the buffer into the byte buffer using the specified options.- Specified by:
compressin 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
public void decompress(java.nio.ByteBuffer in, java.nio.Buffer out, ICompressOption option)Description copied from interface:ICompressorControldecompress the byte buffer back into the buffer using the specified options.- Specified by:
decompressin 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
public ICompressOption option()
- Specified by:
optionin interfaceICompressorControl- Returns:
- a option instance that can be used to control the compression meganism.
-
newCompressor
private ICompressor<java.nio.Buffer> newCompressor(ICompressOption option) throws java.lang.InstantiationException, java.lang.IllegalAccessException, java.lang.reflect.InvocationTargetException
- Throws:
java.lang.InstantiationExceptionjava.lang.IllegalAccessExceptionjava.lang.reflect.InvocationTargetException
-
-