本文整理了Java中org.apache.commons.compress.archivers.zip.ZipArchiveInputStream.count()
方法的一些代码示例,展示了ZipArchiveInputStream.count()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZipArchiveInputStream.count()
方法的具体详情如下:
包路径:org.apache.commons.compress.archivers.zip.ZipArchiveInputStream
类名称:ZipArchiveInputStream
方法名:count
暂无
代码示例来源:origin: org.apache.commons/commons-compress
/**
* Reads bytes by reading from the underlying stream rather than
* the (potentially inflating) archive stream - which {@link #read} would do.
*
* Also updates bytes-read counter.
*/
private int readOneByte() throws IOException {
final int b = in.read();
if (b != -1) {
count(1);
}
return b;
}
代码示例来源:origin: org.apache.commons/commons-compress
private int fill() throws IOException {
if (closed) {
throw new IOException("The stream is closed");
}
final int length = in.read(buf.array());
if (length > 0) {
buf.limit(length);
count(buf.limit());
inf.setInput(buf.array(), 0, buf.limit());
}
return length;
}
代码示例来源:origin: org.apache.commons/commons-compress
/**
* Skips bytes by reading from the underlying stream rather than
* the (potentially inflating) archive stream - which {@link
* #skip} would do.
*
* Also updates bytes-read counter.
*/
private void realSkip(final long value) throws IOException {
if (value >= 0) {
long skipped = 0;
while (skipped < value) {
final long rem = value - skipped;
final int x = in.read(skipBuf, 0, (int) (skipBuf.length > rem ? rem : skipBuf.length));
if (x == -1) {
return;
}
count(x);
skipped += x;
}
return;
}
throw new IllegalArgumentException();
}
代码示例来源:origin: org.apache.commons/commons-compress
private void readFully(final byte[] b, final int off) throws IOException {
final int len = b.length - off;
final int count = IOUtils.readFully(in, b, off, len);
count(count);
if (count < len) {
throw new EOFException();
}
}
代码示例来源:origin: org.apache.commons/commons-compress
/**
* Read all data of the current entry from the underlying stream
* that hasn't been read, yet.
*/
private void drainCurrentEntryData() throws IOException {
long remaining = current.entry.getCompressedSize() - current.bytesReadFromStream;
while (remaining > 0) {
final long n = in.read(buf.array(), 0, (int) Math.min(buf.capacity(), remaining));
if (n < 0) {
throw new EOFException("Truncated ZIP entry: "
+ ArchiveUtils.sanitize(current.entry.getName()));
}
count(n);
remaining -= n;
}
}
代码示例来源:origin: org.apache.commons/commons-compress
count(l);
current.bytesReadFromStream += l;
代码示例来源:origin: com.impetus.fabric/fabric-jdbc-driver-shaded
/**
* Reads bytes by reading from the underlying stream rather than
* the (potentially inflating) archive stream - which {@link #read} would do.
*
* Also updates bytes-read counter.
*/
private int readOneByte() throws IOException {
final int b = in.read();
if (b != -1) {
count(1);
}
return b;
}
代码示例来源:origin: com.impetus.fabric/fabric-jdbc-driver-shaded
private int fill() throws IOException {
if (closed) {
throw new IOException("The stream is closed");
}
final int length = in.read(buf.array());
if (length > 0) {
buf.limit(length);
count(buf.limit());
inf.setInput(buf.array(), 0, buf.limit());
}
return length;
}
代码示例来源:origin: com.impetus.fabric/fabric-jdbc-driver-shaded
/**
* Skips bytes by reading from the underlying stream rather than
* the (potentially inflating) archive stream - which {@link
* #skip} would do.
*
* Also updates bytes-read counter.
*/
private void realSkip(final long value) throws IOException {
if (value >= 0) {
long skipped = 0;
while (skipped < value) {
final long rem = value - skipped;
final int x = in.read(skipBuf, 0, (int) (skipBuf.length > rem ? rem : skipBuf.length));
if (x == -1) {
return;
}
count(x);
skipped += x;
}
return;
}
throw new IllegalArgumentException();
}
代码示例来源:origin: com.impetus.fabric/fabric-jdbc-driver-shaded
private void readFully(final byte[] b) throws IOException {
final int count = IOUtils.readFully(in, b);
count(count);
if (count < b.length) {
throw new EOFException();
}
}
代码示例来源:origin: com.impetus.fabric/fabric-jdbc-driver-shaded
/**
* Read all data of the current entry from the underlying stream
* that hasn't been read, yet.
*/
private void drainCurrentEntryData() throws IOException {
long remaining = current.entry.getCompressedSize() - current.bytesReadFromStream;
while (remaining > 0) {
final long n = in.read(buf.array(), 0, (int) Math.min(buf.capacity(), remaining));
if (n < 0) {
throw new EOFException("Truncated ZIP entry: "
+ ArchiveUtils.sanitize(current.entry.getName()));
}
count(n);
remaining -= n;
}
}
代码示例来源:origin: com.impetus.fabric/fabric-jdbc-driver-shaded
count(l);
current.bytesReadFromStream += l;
内容来源于网络,如有侵权,请联系作者删除!