/** {@inheritDoc} */ @Override public int read() throws IOException { final int ret = in.read(); count(ret == -1 ? 0 : 1); return ret; }
private static boolean internalIsLZMACompressionAvailable() { try { LZMACompressorInputStream.matches(null, 0); return true; } catch (final NoClassDefFoundError error) { return false; } }
throw new CompressorException("LZMA compression is not available" + YOU_NEED_XZ_JAVA); return new LZMACompressorInputStream(in, memoryLimitInKb);
in = new GZIPInputStream(buffered); } else if (s.equals(CompressorStreamFactory.LZMA)) { in = new LZMACompressorInputStream(buffered); } else if (s.equals(CompressorStreamFactory.BZIP2)) { in = new BZip2CompressorInputStream(buffered);
/** * @param stream the stream to read from, should be buffered */ @Override public CompressorInputStream getCompressorStream(InputStream stream) throws IOException { return new LZMACompressorInputStream(stream); }
/** {@inheritDoc} */ @Override public int read(final byte[] buf, final int off, final int len) throws IOException { final int ret = in.read(buf, off, len); count(ret); return ret; }
private static boolean internalIsLZMACompressionAvailable() { try { LZMACompressorInputStream.matches(null, 0); return true; } catch (final NoClassDefFoundError error) { return false; } }
@Override protected InputStream open(InputStream containerInputStream) throws IOException { return new LZMACompressorInputStream(containerInputStream); } }
/** {@inheritDoc} */ @Override public int read() throws IOException { final int ret = in.read(); count(ret == -1 ? 0 : 1); return ret; }
@Override protected InputStream open(InputStream containerInputStream) throws IOException { return new LZMACompressorInputStream(containerInputStream); } }
/** {@inheritDoc} */ @Override public int read(final byte[] buf, final int off, final int len) throws IOException { final int ret = in.read(buf, off, len); count(ret); return ret; }
@Override public CompressorInputStream compressorInputStream(InputStream is) throws IOException { return new LZMACompressorInputStream(is); }
@Override public CompressorInputStream compressorInputStream(InputStream is) throws IOException { return new LZMACompressorInputStream(is); }
@Override public CompressorInputStream open(File compressedFile) throws IOException { InputStream is = new FileInputStream(compressedFile); try { return new LZMACompressorInputStream(is); } catch (IOException ioe) { try { is.close(); } catch (Exception e) {} throw ioe; } }
@Override public CompressorInputStream open(File compressedFile) throws IOException { InputStream is = new FileInputStream(compressedFile); try { return new LZMACompressorInputStream(is); } catch (IOException ioe) { try { is.close(); } catch (Exception e) {} throw ioe; } }
throw new CompressorException("LZMA compression is not available" + YOU_NEED_XZ_JAVA); return new LZMACompressorInputStream(in, memoryLimitInKb);