/** * Returns the total number of compressed bytes input so far, including * gzip header/trailer bytes.</p> * * @return the total (non-negative) number of compressed bytes read so far */ public synchronized long getBytesRead() { return headerBytesRead + inflater.getBytesRead() + trailerBytesRead; }
/** * Get the number of bytes Inflater has actually processed. * * <p>for Java < Java7 the getBytes* methods in * Inflater/Deflater seem to return unsigned ints rather than * longs that start over with 0 at 2^32.</p> * * <p>The stream knows how many bytes it has read, but not how * many the Inflater actually consumed - it should be between the * total number of bytes read for the entry and the total number * minus the last read operation. Here we just try to make the * value close enough to the bytes we've read by assuming the * number of bytes consumed must be smaller than (or equal to) the * number of bytes read but not smaller by more than 2^32.</p> */ private long getBytesInflated() { long inB = inf.getBytesRead(); if (current.bytesReadFromStream >= TWO_EXP_32) { while (inB + TWO_EXP_32 <= current.bytesReadFromStream) { inB += TWO_EXP_32; } } return inB; }
/** * Moved from i2ptunnel HTTPResponseOutputStream.InternalGZIPInputStream * @since 0.8.9 */ public long getTotalRead() { try { return inf.getBytesRead(); } catch (RuntimeException e) { return 0; } }
/** * Inflater statistic */ public long getTotalRead() { try { return inf.getBytesRead(); } catch (RuntimeException e) { return 0; } }
o += n; if (inf.finished()) { deflatedSize = inf.getBytesRead(); break; } else if (n <= 0 && inf.needsInput()) { long p = pos + 4 + inf.getBytesRead(); readBlockIntoBuf(src, p, fileBlockSize); inf.setInput(buf, 0, bufLen);
if (!inf.finished() || inf.getBytesRead() != dataLength) { setCorrupt(src.offset); throw new EOFException(MessageFormat.format(
if (!inf.finished() || inf.getBytesRead() != dataLength) { setCorrupt(src.offset); throw new EOFException(MessageFormat.format(
/** * Returns the total number of compressed bytes input so far, including * gzip header/trailer bytes.</p> * * @return the total (non-negative) number of compressed bytes read so far */ public synchronized long getBytesRead() { return headerBytesRead + inflater.getBytesRead() + trailerBytesRead; }
/** * Returns the total number of compressed bytes input so far, including * gzip header/trailer bytes.</p> * * @return the total (non-negative) number of compressed bytes read so far */ public synchronized long getBytesRead() { return headerBytesRead + inflater.getBytesRead() + trailerBytesRead; }
/** * Returns the total number of compressed bytes input so far, including * gzip header/trailer bytes.</p> * * @return the total (non-negative) number of compressed bytes read so far */ public synchronized long getBytesRead() { return headerBytesRead + inflater.getBytesRead() + trailerBytesRead; }
/** * Returns the total number of compressed bytes input so far, including * gzip header/trailer bytes.</p> * * @return the total (non-negative) number of compressed bytes read so far */ public synchronized long getBytesRead() { return headerBytesRead + inflater.getBytesRead() + trailerBytesRead; }
@Override public long getBytesRead() { return inflater.getBytesRead(); }
/** * Get the number of bytes Inflater has actually processed. * for Java < Java7 the getBytes* methods in * Inflater/Deflater seem to return unsigned ints rather than * longs that start over with 0 at 2^32. * The stream knows how many bytes it has read, but not how * many the Inflater actually consumed - it should be between the * total number of bytes read for the entry and the total number * minus the last read operation. Here we just try to make the * value close enough to the bytes we've read by assuming the * number of bytes consumed must be smaller than (or equal to) the * number of bytes read but not smaller by more than 2^32. */ private long getBytesInflated() { long inB = inf.getBytesRead(); if (current.bytesReadFromStream >= TWO_EXP_32) { while (inB + TWO_EXP_32 <= current.bytesReadFromStream) { inB += TWO_EXP_32; } } return inB; }
public long getCompressedBytesRead() { long amtRead = header.getLength() + inflater.getBytesRead(); if(gotEOR) { amtRead += GZIP_STATIC_FOOTER_SIZE; } return amtRead; }
public long getCompressedBytesRead() { long amtRead = header.getLength() + inflater.getBytesRead(); if(gotEOR) { amtRead += GZIP_STATIC_FOOTER_SIZE; } return amtRead; }
public long getCompressedBytesRead() { long amtRead = header.getLength() + inflater.getBytesRead(); if(gotEOR) { amtRead += GZIP_STATIC_FOOTER_SIZE; } return amtRead; }
public final class ExposedGZIPInputStream extends GZIPInputStream { public ExposedGZIPInputStream(final InputStream stream) { super(stream); } public ExposedGZIPInputStream(final InputStream stream, final int n) { super(stream, n); } public Inflater inflater() { return super.inf; } } ... final ExposedGZIPInputStream gzip = new ExposedGZIPInputStream(...); ... final Inflater inflater = gzip.inflater(); final long read = inflater.getBytesRead();
private static String toDetail(Inflater inflater) { return String.format("Inflater[finished=%b,read=%d,written=%d,remaining=%d,in=%d,out=%d]",inflater.finished(),inflater.getBytesRead(), inflater.getBytesWritten(),inflater.getRemaining(),inflater.getTotalIn(),inflater.getTotalOut()); }
private static String toDetail(Inflater inflater) { return String.format("Inflater[finished=%b,read=%d,written=%d,remaining=%d,in=%d,out=%d]", inflater.finished(), inflater.getBytesRead(), inflater.getBytesWritten(), inflater.getRemaining(), inflater.getTotalIn(), inflater.getTotalOut()); }
private static String toDetail(Inflater inflater) { return String.format("Inflater[finished=%b,read=%d,written=%d,remaining=%d,in=%d,out=%d]", inflater.finished(), inflater.getBytesRead(), inflater.getBytesWritten(), inflater.getRemaining(), inflater.getTotalIn(), inflater.getTotalOut()); }