List of usage examples for org.apache.commons.compress.compressors.xz XZCompressorInputStream XZCompressorInputStream
public XZCompressorInputStream(InputStream inputStream, boolean decompressConcatenated, final int memoryLimitInKb) throws IOException
From source file:net.yacy.document.parser.XZParser.java
@Override protected CompressorInputStream createDecompressStream(final InputStream source) throws IOException { /*//from w w w .j a v a2 s.c o m * Limit the size dedicated to reading compressed blocks to at most 25% of the * available memory. Eventual stricter limits should be handled by the caller * (see for example crawler.[protocol].maxFileSize configuration setting). */ final long availableMemory = MemoryControl.available(); final long maxKBytes = (long) (availableMemory * 0.25 / 1024.0); return new XZCompressorInputStream(source, false, (int) Math.min(Integer.MAX_VALUE, maxKBytes)); }