Refine search
/** * Creates a new LZF decoder with specified decoding instance. * * @param safeInstance * If {@code true} decoder will use {@link ChunkDecoder} that only uses standard JDK access methods, * and should work on all Java platforms and JVMs. * Otherwise decoder will try to use highly optimized {@link ChunkDecoder} implementation that uses * Sun JDK's {@link sun.misc.Unsafe} class (which may be included by other JDK's as well). */ public LzfDecoder(boolean safeInstance) { decoder = safeInstance ? ChunkDecoderFactory.safeInstance() : ChunkDecoderFactory.optimalInstance(); recycler = BufferRecycler.instance(); }
/** * @param in Underlying input stream to use * @param fullReads Whether {@link #read(byte[])} should try to read exactly * as many bytes as requested (true); or just however many happen to be * available (false) */ public LZFInputStream(final InputStream in, boolean fullReads) throws IOException { this(ChunkDecoderFactory.optimalInstance(), in, BufferRecycler.instance(), fullReads); }
/** * @param in Underlying input stream to use * @param fullReads Whether {@link #read(byte[])} should try to read exactly * as many bytes as requested (true); or just however many happen to be * available (false) * @param bufferRecycler Buffer recycler instance, for usages where the * caller manages the recycler instances */ public LZFInputStream(final InputStream in, final BufferRecycler bufferRecycler, boolean fullReads) throws IOException { this(ChunkDecoderFactory.optimalInstance(), in, bufferRecycler, fullReads); }
/** * Accessor method that can be used to obtain {@link ChunkDecoder} * that only uses standard JDK access methods, and should work on * all Java platforms and JVMs. */ public static ChunkDecoder safeDecoder() { // race conditions are ok here, we don't really mind ChunkDecoder dec = _safeDecoderRef.get(); if (dec == null) { // dec = ChunkDecoderFactory.safeInstance(); _safeDecoderRef.compareAndSet(null, dec); } return dec; }
public LZFFileInputStream(FileDescriptor fdObj) { this(fdObj, ChunkDecoderFactory.optimalInstance(), BufferRecycler.instance()); }
/** * @param in Underlying input stream to use * @param fullReads Whether {@link #read(byte[])} should try to read exactly * as many bytes as requested (true); or just however many happen to be * available (false) * @param bufferRecycler Buffer recycler instance, for usages where the * caller manages the recycler instances */ public LZFInputStream(final InputStream in, final BufferRecycler bufferRecycler, boolean fullReads) throws IOException { this(ChunkDecoderFactory.optimalInstance(), in, bufferRecycler, fullReads); }
/** * Accessor method that can be used to obtain {@link ChunkDecoder} * that only uses standard JDK access methods, and should work on * all Java platforms and JVMs. */ public static ChunkDecoder safeDecoder() { // race conditions are ok here, we don't really mind ChunkDecoder dec = _safeDecoderRef.get(); if (dec == null) { // dec = ChunkDecoderFactory.safeInstance(); _safeDecoderRef.compareAndSet(null, dec); } return dec; }
/** * Creates a new LZF decoder with specified decoding instance. * * @param safeInstance * If {@code true} decoder will use {@link ChunkDecoder} that only uses standard JDK access methods, * and should work on all Java platforms and JVMs. * Otherwise decoder will try to use highly optimized {@link ChunkDecoder} implementation that uses * Sun JDK's {@link sun.misc.Unsafe} class (which may be included by other JDK's as well). */ public LzfDecoder(boolean safeInstance) { decoder = safeInstance ? ChunkDecoderFactory.safeInstance() : ChunkDecoderFactory.optimalInstance(); recycler = BufferRecycler.instance(); }
/** * @param in Underlying input stream to use * @param fullReads Whether {@link #read(byte[])} should try to read exactly * as many bytes as requested (true); or just however many happen to be * available (false) */ public LZFInputStream(final InputStream in, boolean fullReads) throws IOException { this(ChunkDecoderFactory.optimalInstance(), in, BufferRecycler.instance(), fullReads); }
/** * @param in Underlying input stream to use * @param fullReads Whether {@link #read(byte[])} should try to read exactly * as many bytes as requested (true); or just however many happen to be * available (false) * @param bufferRecycler Buffer recycler instance, for usages where the * caller manages the recycler instances */ public LZFInputStream(final InputStream in, final BufferRecycler bufferRecycler, boolean fullReads) throws IOException { this(ChunkDecoderFactory.optimalInstance(), in, bufferRecycler, fullReads); }
/** * Accessor method that can be used to obtain {@link ChunkDecoder} * that only uses standard JDK access methods, and should work on * all Java platforms and JVMs. */ public static ChunkDecoder safeDecoder() { // race conditions are ok here, we don't really mind ChunkDecoder dec = _safeDecoderRef.get(); if (dec == null) { // dec = ChunkDecoderFactory.safeInstance(); _safeDecoderRef.compareAndSet(null, dec); } return dec; }
/** * Creates a new LZF decoder with specified decoding instance. * * @param safeInstance * If {@code true} decoder will use {@link ChunkDecoder} that only uses standard JDK access methods, * and should work on all Java platforms and JVMs. * Otherwise decoder will try to use highly optimized {@link ChunkDecoder} implementation that uses * Sun JDK's {@link sun.misc.Unsafe} class (which may be included by other JDK's as well). */ public LzfDecoder(boolean safeInstance) { decoder = safeInstance ? ChunkDecoderFactory.safeInstance() : ChunkDecoderFactory.optimalInstance(); recycler = BufferRecycler.instance(); }
public LZFUncompressor(DataHandler handler) { this(handler, ChunkDecoderFactory.optimalInstance(), BufferRecycler.instance()); }
public LZFUncompressor(DataHandler handler, BufferRecycler bufferRecycler) { this(handler, ChunkDecoderFactory.optimalInstance(), bufferRecycler); }
public LZFCompressor() { this.decoder = ChunkDecoderFactory.safeInstance(); Loggers.getLogger(LZFCompressor.class).debug("using decoder[{}] ", this.decoder.getClass().getSimpleName()); }
/** * Creates a new LZF decoder with specified decoding instance. * * @param safeInstance * If {@code true} decoder will use {@link ChunkDecoder} that only uses standard JDK access methods, * and should work on all Java platforms and JVMs. * Otherwise decoder will try to use highly optimized {@link ChunkDecoder} implementation that uses * Sun JDK's {@link sun.misc.Unsafe} class (which may be included by other JDK's as well). */ public LzfDecoder(boolean safeInstance) { decoder = safeInstance ? ChunkDecoderFactory.safeInstance() : ChunkDecoderFactory.optimalInstance(); recycler = BufferRecycler.instance(); }
/** * @param in Underlying input stream to use * @param fullReads Whether {@link #read(byte[])} should try to read exactly * as many bytes as requested (true); or just however many happen to be * available (false) */ public LZFInputStream(final InputStream in, boolean fullReads) throws IOException { this(ChunkDecoderFactory.optimalInstance(), in, BufferRecycler.instance(), fullReads); }
public LZFUncompressor(DataHandler handler, BufferRecycler bufferRecycler) { this(handler, ChunkDecoderFactory.optimalInstance(), bufferRecycler); }
/** * Creates a new LZF decoder with specified decoding instance. * * @param safeInstance * If {@code true} decoder will use {@link ChunkDecoder} that only uses standard JDK access methods, * and should work on all Java platforms and JVMs. * Otherwise decoder will try to use highly optimized {@link ChunkDecoder} implementation that uses * Sun JDK's {@link sun.misc.Unsafe} class (which may be included by other JDK's as well). */ public LzfDecoder(boolean safeInstance) { decoder = safeInstance ? ChunkDecoderFactory.safeInstance() : ChunkDecoderFactory.optimalInstance(); recycler = BufferRecycler.instance(); }
public LZFFileInputStream(String name) throws FileNotFoundException { this(name, ChunkDecoderFactory.optimalInstance(), BufferRecycler.instance()); }