Package com.ning.compress.lzf.util
Class ChunkDecoderFactory
- java.lang.Object
-
- com.ning.compress.lzf.util.ChunkDecoderFactory
-
public class ChunkDecoderFactory extends java.lang.Object
Simple helper class used for loadingChunkDecoder
implementations, based on criteria such as "fastest available".Yes, it looks butt-ugly, but does the job. Nonetheless, if anyone has lipstick for this pig, let me know.
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.Class<? extends ChunkDecoder>
_implClass
private static ChunkDecoderFactory
_instance
-
Constructor Summary
Constructors Modifier Constructor Description private
ChunkDecoderFactory(java.lang.Class<?> imp)
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static ChunkDecoder
optimalInstance()
Method to use for getting decoder instance that uses the most optimal available methods for underlying data access.static ChunkDecoder
safeInstance()
Method that can be used to ensure that a "safe" decoder instance is loaded.
-
-
-
Field Detail
-
_instance
private static final ChunkDecoderFactory _instance
-
_implClass
private final java.lang.Class<? extends ChunkDecoder> _implClass
-
-
Method Detail
-
optimalInstance
public static ChunkDecoder optimalInstance()
Method to use for getting decoder instance that uses the most optimal available methods for underlying data access. It should be safe to call this method as implementations are dynamically loaded; however, on some non-standard platforms it may be necessary to either directly load instances, or usesafeInstance()
.
-
safeInstance
public static ChunkDecoder safeInstance()
Method that can be used to ensure that a "safe" decoder instance is loaded. Safe here means that it should work on any and all Java platforms.
-
-