gpt4 book ai didi

org.apache.commons.compress.compressors.z.ZCompressorInputStream.()方法的使用及代码示例

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

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

ZCompressorInputStream.<init>介绍

暂无

代码示例

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

return new ZCompressorInputStream(in, memoryLimitInKb);

代码示例来源: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: 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: de.unkrig/de-unkrig-commons

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

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

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

代码示例来源: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: 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: de.unkrig/de-unkrig-commons

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

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

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

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

@Override public CompressorInputStream
open(File compressedFile) throws IOException {
  InputStream is = new FileInputStream(compressedFile);
  try {
    return new ZCompressorInputStream(is);
  } catch (IOException ioe) {
    try { is.close(); } catch (Exception e) {}
    throw ioe;
  }
}

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

@Override public CompressorInputStream
open(File compressedFile) throws IOException {
  InputStream is = new FileInputStream(compressedFile);
  try {
    return new ZCompressorInputStream(is);
  } catch (IOException ioe) {
    try { is.close(); } catch (Exception e) {}
    throw ioe;
  }
}

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

import org.apache.commons.compress.compressors.z.ZCompressorInputStream;

...

FileInputStream fin = new FileInputStream("/path/to/archive.something.Z");
BufferedInputStream in = new BufferedInputStream(fin);
ZCompressorInputStream zIn = new ZCompressorInputStream(in);

BufferedReader br = new BufferedReader(new InputStreamReader(zIn));

while (null != (content = br.readLine())) {
 System.out.println(content);
}
br.close();

代码示例来源:origin: castorini/Anserini

@SuppressWarnings("unchecked")
public FileSegment(Path path) throws IOException {
 this.path = path;
 this.bufferedReader = null;
 String fileName = path.toString();
 if (fileName.matches("(?i:.*?\\.\\d*z$)")) { // .z .0z .1z .2z
  FileInputStream fin = new FileInputStream(fileName);
  BufferedInputStream in = new BufferedInputStream(fin);
  ZCompressorInputStream zIn = new ZCompressorInputStream(in);
  bufferedReader = new BufferedReader(new InputStreamReader(zIn, StandardCharsets.UTF_8));
 } else if (fileName.endsWith(".gz")) { //.gz
  InputStream stream = new GZIPInputStream(
    Files.newInputStream(path, StandardOpenOption.READ), BUFFER_SIZE);
  bufferedReader = new BufferedReader(new InputStreamReader(stream, StandardCharsets.UTF_8));
 } else { // plain text file
  bufferedReader = new BufferedReader(new FileReader(fileName));
 }
}

代码示例来源: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: lucene4ir/lucene4ir

protected BufferedReader openDocumentFile(String filename){
  BufferedReader br = null;
  try {
    if(filename.endsWith(".gz")) {
      InputStream fileStream = new FileInputStream(filename);
      InputStream gzipStream = new GZIPInputStream(fileStream);
      Reader decoder = new InputStreamReader(gzipStream, "UTF-8");
      br = new BufferedReader(decoder);
    }
    else
    {
      // For the weirdness that is TREC collections.
      if (filename.endsWith(".Z") || filename.endsWith(".0Z") || filename.endsWith(".1Z") || filename.endsWith(".2Z")) {
        InputStream fileStream = new FileInputStream(filename);
        //InputStream zipStream = new ZCompressorInputStream(fileStream);
        ZCompressorInputStream zipStream = new ZCompressorInputStream(fileStream);
        Reader decoder = new InputStreamReader(zipStream, "UTF-8");
        br = new BufferedReader(decoder);
      }
      else
        br = new BufferedReader(new FileReader(filename));
    }
  } catch (Exception e){
    e.printStackTrace();
    System.exit(1);
  }
  return br;
}

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

return new ZCompressorInputStream(in, memoryLimitInKb);

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