@Override public void reset() { resetNative(nowrap); inputBuffer = null; inputBufferLength = 0; finished = false; }
/** * Returns true if the end of the compressed data output stream has * been reached. * @return true if the end of the compressed data output stream has * been reached */ @Override public int inflate (byte[] b ) { return inflateNative( b, 0, b.length); }
@Override public void reset() { resetNative(nowrap); inputBuffer = null; inputBufferLength = 0; endOfStream = false; finished = false; }
public void initializeCompressionAndDecompression() { // Use the Intel Inflater/Deflater for accelerated BAM reading/writing, if possible: if (! getArguments().useJdkDeflater) { BlockCompressedOutputStream.setDefaultDeflaterFactory(new IntelDeflaterFactory()); } if (! getArguments().useJdkInflater) { BlockGunzipper.setDefaultInflaterFactory(new IntelInflaterFactory()); } final boolean usingIntelDeflater = (BlockCompressedOutputStream.getDefaultDeflaterFactory() instanceof IntelDeflaterFactory && ((IntelDeflaterFactory)BlockCompressedOutputStream.getDefaultDeflaterFactory()).usingIntelDeflater()); logger.info("Deflater: " + (usingIntelDeflater ? "IntelDeflater": "JdkDeflater")); final boolean usingIntelInflater = (BlockGunzipper.getDefaultInflaterFactory() instanceof IntelInflaterFactory && ((IntelInflaterFactory)BlockGunzipper.getDefaultInflaterFactory()).usingIntelInflater()); logger.info("Inflater: " + (usingIntelInflater ? "IntelInflater": "JdkInflater")); }
public IntelDeflaterFactory(File tmpDir) { intelDeflaterSupported = new IntelDeflater().load(tmpDir); }
static DeflaterFactory newDeflaterFactory() { return new IntelDeflaterFactory(); } }
static InflaterFactory newInflatorFactor() { return new IntelInflaterFactory(); } static DeflaterFactory newDeflaterFactory() {
public IntelInflaterFactory(File tmpDir) { intelInflaterSupported = new IntelInflater().load(tmpDir); }
public boolean load() { return load(null); }
/** * Closes the compressor and discards any unprocessed input. * This method should be called when the compressor is no longer * being used, but will also be called automatically by the * finalize() method. Once this method is called, the behavior * of the IntelDeflater object is undefined. */ @Override public void end() { endNative(); }
/** * Compresses the input data and fills specified buffer with compressed * data. Returns actual number of bytes of compressed data. A return value * of 0 indicates that {@link #needsInput() needsInput} should be called * in order to determine if more input data is required. * * @param b the buffer for the compressed data * @param off the start offset of the data * @param len the maximum number of bytes of compressed data * @return the actual number of bytes of compressed data written to the * output buffer */ public int deflate(byte[] b, int off, int len ) { return deflateNative(b, len); }
public boolean load(File tmpDir) { isSupported = IntelGKLUtils.load(tmpDir); if (isSupported) { initNative(); } return isSupported; }
/** * Closes the compressor when garbage is collected. */ protected void finalize() { end(); } }
/** * Closes the compressor and discards any unprocessed input. * This method should be called when the compressor is no longer * being used, but will also be called automatically by the * finalize() method. Once this method is called, the behavior * of the IntelDeflater object is undefined. */ @Override public void end() { if(lz_stream != 0) { endNative(); lz_stream = 0; } } }
static DeflaterFactory newDeflaterFactory() { return new IntelDeflaterFactory(); } }
static InflaterFactory newInflatorFactor() { return new IntelInflaterFactory(); } static DeflaterFactory newDeflaterFactory() {
public void reset() { logger.debug("Reset deflater"); resetNative(nowrap); inputBuffer = null; inputBufferLength = 0; endOfStream = false; finished = false; }
/** * Closes the compressor and discards any unprocessed input. * This method should be called when the compressor is no longer * being used, but will also be called automatically by the * finalize() method. Once this method is called, the behavior * of the IntelDeflater object is undefined. */ @Override public void end() { if(lz_stream != 0) { endNative(); lz_stream = 0; } } }
/** * Compresses the input data and fills specified buffer with compressed * data. Returns actual number of bytes of compressed data. A return value * of 0 indicates that {@link #needsInput() needsInput} should be called * in order to determine if more input data is required. * * @param b the buffer for the compressed data * @param off the start offset of the data * @param len the maximum number of bytes of compressed data * @return the actual number of bytes of compressed data written to the * output buffer */ @Override public int deflate(byte[] b, int off, int len ) { return deflateNative(b, len); }
/** * Compresses the input data and fills specified buffer with compressed * data. Returns actual number of bytes of compressed data. A return value * of 0 indicates that {@link #needsInput() needsInput} should be called * in order to determine if more input data is required. * * @param b the buffer for the compressed data * @param off the start offset of the data * @param len the maximum number of bytes of compressed data * @return the actual number of bytes of compressed data written to the * output buffer */ @Override public int inflate (byte[] b, int off, int len ) { return inflateNative(b, off, len); }