gpt4 book ai didi

org.apache.commons.compress.compressors.z.ZCompressorInputStream类的使用及代码示例

转载 作者:知者 更新时间:2024-03-14 21:42:49 25 4
gpt4 key购买 nike

本文整理了Java中org.apache.commons.compress.compressors.z.ZCompressorInputStream类的一些代码示例,展示了ZCompressorInputStream类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZCompressorInputStream类的具体详情如下:
包路径:org.apache.commons.compress.compressors.z.ZCompressorInputStream
类名称:ZCompressorInputStream

ZCompressorInputStream介绍

[英]Input stream that decompresses .Z files.
[中]解压的输入流。Z文件。

代码示例

代码示例来源:origin: org.apache.commons/commons-compress

return new ZCompressorInputStream(in, memoryLimitInKb);

代码示例来源:origin: org.apache.commons/commons-compress

if (ZCompressorInputStream.matches(signature, signatureLength)) {
  return Z;

代码示例来源:origin: org.apache.commons/commons-compress

/**
 * {@inheritDoc}
 * <p><strong>This method is only protected for technical reasons
 * and is not part of Commons Compress' published API.  It may
 * change or disappear without warning.</strong></p>
 */
@Override
protected int addEntry(final int previousCode, final byte character) throws IOException {
  final int maxTableSize = 1 << getCodeSize();
  final int r = addEntry(previousCode, character, maxTableSize);
  if (getTableSize() == maxTableSize && getCodeSize() < maxCodeSize) {
    reAlignReading();
    incrementCodeSize();
  }
  return r;
}

代码示例来源:origin: org.apache.commons/commons-compress

final int code = readNextCode();
if (code < 0) {
  return -1;
} else if (blockMode && code == getClearCode()) {
  clearEntries();
  reAlignReading();
  resetCodeSize();
  resetPreviousCode();
  return 0;
} else {
  boolean addedUnfinishedEntry = false;
  if (code == getTableSize()) {
    addRepeatOfPreviousCode();
    addedUnfinishedEntry = true;
  } else if (code > getTableSize()) {
    throw new IOException(String.format("Invalid %d bit code 0x%x", getCodeSize(), code));
  return expandCodeToOutputStack(code, addedUnfinishedEntry);

代码示例来源:origin: org.apache.commons/commons-compress

public ZCompressorInputStream(final InputStream inputStream, final int memoryLimitInKb)
    throws IOException {
  super(inputStream, ByteOrder.LITTLE_ENDIAN);
  final int firstByte = (int) in.readBits(8);
  final int secondByte = (int) in.readBits(8);
  final int thirdByte = (int) in.readBits(8);
  if (firstByte != MAGIC_1 || secondByte != MAGIC_2 || thirdByte < 0) {
    throw new IOException("Input is not in .Z format");
  }
  blockMode = (thirdByte & BLOCK_MODE_MASK) != 0;
  maxCodeSize = thirdByte & MAX_CODE_SIZE_MASK;
  if (blockMode) {
    setClearCode(DEFAULT_CODE_SIZE);
  }
  initializeTables(maxCodeSize, memoryLimitInKb);
  clearEntries();
}

代码示例来源:origin: stackoverflow.com

FileInputStream fin = new FileInputStream("archive.tar.Z");
BufferedInputStream in = new BufferedInputStream(fin);
FileOutputStream out = new FileOutputStream("archive.tar");
ZCompressorInputStream zIn = new ZCompressorInputStream(in);
final byte[] buffer = new byte[buffersize];
int n = 0;
while (-1 != (n = zIn.read(buffer))) {
  out.write(buffer, 0, n);
}
out.close();
zIn.close();

代码示例来源:origin: com.impetus.fabric/fabric-jdbc-driver-shaded

final int code = readNextCode();
if (code < 0) {
  return -1;
} else if (blockMode && code == getClearCode()) {
  clearEntries();
  reAlignReading();
  resetCodeSize();
  resetPreviousCode();
  return 0;
} else {
  boolean addedUnfinishedEntry = false;
  if (code == getTableSize()) {
    addRepeatOfPreviousCode();
    addedUnfinishedEntry = true;
  } else if (code > getTableSize()) {
    throw new IOException(String.format("Invalid %d bit code 0x%x", getCodeSize(), code));
  return expandCodeToOutputStack(code, addedUnfinishedEntry);

代码示例来源:origin: com.impetus.fabric/fabric-jdbc-driver-shaded

public ZCompressorInputStream(final InputStream inputStream, final int memoryLimitInKb)
    throws IOException {
  super(inputStream, ByteOrder.LITTLE_ENDIAN);
  final int firstByte = (int) in.readBits(8);
  final int secondByte = (int) in.readBits(8);
  final int thirdByte = (int) in.readBits(8);
  if (firstByte != MAGIC_1 || secondByte != MAGIC_2 || thirdByte < 0) {
    throw new IOException("Input is not in .Z format");
  }
  blockMode = (thirdByte & BLOCK_MODE_MASK) != 0;
  maxCodeSize = thirdByte & MAX_CODE_SIZE_MASK;
  if (blockMode) {
    setClearCode(DEFAULT_CODE_SIZE);
  }
  initializeTables(maxCodeSize, memoryLimitInKb);
  clearEntries();
}

代码示例来源:origin: apache/tika

is = new GzipCompressorInputStream(is);
} else if (fileSuffixes.compression.equals("zip")) {
  is = new ZCompressorInputStream(is);
} else {
  LOG.warn("Can't yet process compression of type: {}", fileSuffixes.compression);

代码示例来源:origin: com.impetus.fabric/fabric-jdbc-driver-shaded

/**
 * {@inheritDoc}
 * <p><strong>This method is only protected for technical reasons
 * and is not part of Commons Compress' published API.  It may
 * change or disappear without warning.</strong></p>
 */
@Override
protected int addEntry(final int previousCode, final byte character) throws IOException {
  final int maxTableSize = 1 << getCodeSize();
  final int r = addEntry(previousCode, character, maxTableSize);
  if (getTableSize() == maxTableSize && getCodeSize() < maxCodeSize) {
    reAlignReading();
    incrementCodeSize();
  }
  return r;
}

代码示例来源:origin: de.unkrig.commons/commons-file

@Override public boolean
matches(byte[] signature, int signatureLength) {
  return ZCompressorInputStream.matches(signature, signatureLength);
}

代码示例来源:origin: de.unkrig/de-unkrig-commons

@Override protected InputStream
  open(InputStream containerInputStream) throws IOException {
    return new ZCompressorInputStream(containerInputStream);
  }
}

代码示例来源:origin: de.unkrig/de-unkrig-commons

@Override public boolean
matches(byte[] signature, int signatureLength) {
  return ZCompressorInputStream.matches(signature, signatureLength);
}

代码示例来源:origin: de.unkrig.commons/commons-file

@Override protected InputStream
  open(InputStream containerInputStream) throws IOException {
    return new ZCompressorInputStream(containerInputStream);
  }
}

代码示例来源:origin: com.impetus.fabric/fabric-jdbc-driver-shaded

if (ZCompressorInputStream.matches(signature, signatureLength)) {
  return Z;

代码示例来源:origin: org.apache.ant/ant-compress

/**
 * @param stream the stream to read from, should be buffered
 */
@Override
public CompressorInputStream getCompressorStream(InputStream stream)
  throws IOException {
  return new ZCompressorInputStream(stream);
}

代码示例来源:origin: gov.nasa.gsfc.heasarc/nom-tam-fits

public static InputStream createZStream(InputStream in) throws IOException {
    return new org.apache.commons.compress.compressors.z.ZCompressorInputStream(in);
  }
}

代码示例来源:origin: nom-tam-fits/nom-tam-fits

public static InputStream createZStream(InputStream in) throws IOException {
    return new org.apache.commons.compress.compressors.z.ZCompressorInputStream(in);
  }
}

代码示例来源:origin: de.unkrig.commons/commons-file

@Override public CompressorInputStream
compressorInputStream(InputStream is) throws IOException { return new ZCompressorInputStream(is); }

代码示例来源:origin: de.unkrig/de-unkrig-commons

@Override public CompressorInputStream
compressorInputStream(InputStream is) throws IOException { return new ZCompressorInputStream(is); }

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com