本文整理了Java中org.apache.commons.compress.archivers.zip.ZipArchiveInputStream.read()
方法的一些代码示例,展示了ZipArchiveInputStream.read()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZipArchiveInputStream.read()
方法的具体详情如下:
包路径:org.apache.commons.compress.archivers.zip.ZipArchiveInputStream
类名称:ZipArchiveInputStream
方法名:read
[英]Implementation of read for DEFLATED entries.
[中]对泄气条目执行读取。
代码示例来源:origin: org.apache.commons/commons-compress
while (skipped < value) {
final long rem = value - skipped;
final int x = read(skipBuf, 0, (int) (skipBuf.length > rem ? rem : skipBuf.length));
if (x == -1) {
return skipped;
代码示例来源:origin: pxb1988/dex2jar
@Test
public void test1() throws IOException {
ZipArchiveInputStream zis = new ZipArchiveInputStream(BadZipEntryFlagTest.class.getResourceAsStream("/bad.zip"));
for (ZipArchiveEntry e = zis.getNextZipEntry(); e != null; e = zis.getNextZipEntry()) {
e.getGeneralPurposeBit().useEncryption(false);
if (!e.isDirectory()) {
zis.read();
System.out.println(e.getName());
}
}
}
代码示例来源:origin: stackoverflow.com
try(ZipArchiveInputStream zipArchiveInputStream = new ZipArchiveInputStream(fileInputStream)) {
ZipArchiveEntry zipEntry;
while ((zipEntry = zipArchiveInputStream.getNextZipEntry()) != null){
String fileName = zipEntry.getName();
final File file = new File(fileName);
FileUtil.createMissingParentDirectories(file);
try(FileOutputStream fileOutputStream = new FileOutputStream(file.getAbsolutePath())) {(file.read.buffer)
try(BufferedOutputStream bos = new BufferedOutputStream(fileOutputStream, 1024)) {
int n = 0;
byte[] content = new byte[1024];
while ((n = zipArchiveInputStream.read(content)) != -1) {
fileOutputStream.write(content, 0, n);
}
bos.flush();
}
}
}
}
}
代码示例来源:origin: com.impetus.fabric/fabric-jdbc-driver-shaded
while (skipped < value) {
final long rem = value - skipped;
final int x = read(skipBuf, 0, (int) (skipBuf.length > rem ? rem : skipBuf.length));
if (x == -1) {
return skipped;
代码示例来源:origin: kriegaex/Galileo-Openbook-Cleaner
throw new IOException("Cannot create directory '" + parentDir + "'");
outUnzipped = new BufferedOutputStream(new FileOutputStream(unzippedFile), BUFFER_SIZE);
while ((byteCount = zipStream.read(buffer, 0, BUFFER_SIZE)) != -1)
outUnzipped.write(buffer, 0, byteCount);
outUnzipped.close();
代码示例来源:origin: stackoverflow.com
fos = new FileOutputStream(file);
int read;
while ((read = zis.read(buffer,0,buffer.length)) != -1)
fos.write(buffer,0,read);
fos.close();
代码示例来源:origin: apache/incubator-slider
int offset = 0;
while (offset < size) {
offset += zis.read(content, offset, size - offset);
ByteArrayOutputStream baos = new ByteArrayOutputStream();
while (true) {
int byteRead = zis.read();
if (byteRead == -1) {
break;
代码示例来源:origin: org.apache.slider/slider-core
int offset = 0;
while (offset < size) {
offset += zis.read(content, offset, size - offset);
ByteArrayOutputStream baos = new ByteArrayOutputStream();
while (true) {
int byteRead = zis.read();
if (byteRead == -1) {
break;
代码示例来源:origin: stackoverflow.com
zipStream.read(data);
代码示例来源:origin: crosswire/jsword
offset += zin.read(buffer, offset, size - offset);
内容来源于网络,如有侵权,请联系作者删除!