@Override protected byte[] getTrailer() { byte[] ret = new byte[8]; int checksum = (int) crc.getValue(); int total = deflater.getTotalIn(); ret[0] = (byte) ((checksum) & 0xFF); ret[1] = (byte) ((checksum >> 8) & 0xFF); ret[2] = (byte) ((checksum >> 16) & 0xFF); ret[3] = (byte) ((checksum >> 24) & 0xFF); ret[4] = (byte) ((total) & 0xFF); ret[5] = (byte) ((total >> 8) & 0xFF); ret[6] = (byte) ((total >> 16) & 0xFF); ret[7] = (byte) ((total >> 24) & 0xFF); return ret; } }
private void writeTrailer() throws IOException { final ByteBuffer buffer = ByteBuffer.allocate(8); buffer.order(ByteOrder.LITTLE_ENDIAN); buffer.putInt((int) crc.getValue()); buffer.putInt(deflater.getTotalIn()); out.write(buffer.array()); }
int uncBytes = deflater.getTotalIn(); footer.writeByte(crcValue); footer.writeByte(crcValue >>> 8);
/** re-implement because the relative method in jdk is invisible */ private void writeTrailer(byte[] paramArrayOfByte, int paramInt) throws IOException { writeInt((int)this.crc.getValue(), paramArrayOfByte, paramInt); writeInt(this.def.getTotalIn(), paramArrayOfByte, paramInt + 4); }
int uncBytes = deflater.getTotalIn(); footer.writeByte(crcValue); footer.writeByte(crcValue >>> 8);
final int arrayOffset = src.arrayOffset(); deflater.setInput(array, arrayOffset + pos, rem); c1 = deflater.getTotalIn(); final int dc = deflater.deflate(outArray, outBuffer.position(), outBuffer.remaining()); outBuffer.position(outBuffer.position() + dc); t = deflater.getTotalIn() - c1; src.position(pos + t); cnt += t; final byte[] bytes = Buffers.take(src); deflater.setInput(bytes); c1 = deflater.getTotalIn(); final int dc = deflater.deflate(outArray, outBuffer.position(), outBuffer.remaining()); outBuffer.position(outBuffer.position() + dc); t = deflater.getTotalIn() - c1; src.position(pos + t); cnt += t;
final int arrayOffset = src.arrayOffset(); deflater.setInput(array, arrayOffset + pos, rem); c1 = deflater.getTotalIn(); final int dc = deflater.deflate(outArray, outBuffer.position(), outBuffer.remaining()); outBuffer.position(outBuffer.position() + dc); t = deflater.getTotalIn() - c1; src.position(pos + t); cnt += t; final byte[] bytes = Buffers.take(src); deflater.setInput(bytes); c1 = deflater.getTotalIn(); final int dc = deflater.deflate(outArray, outBuffer.position(), outBuffer.remaining()); outBuffer.position(outBuffer.position() + dc); t = deflater.getTotalIn() - c1; src.position(pos + t); cnt += t;
int uncBytes = deflater.getTotalIn(); footer.writeByte(crcValue); footer.writeByte(crcValue >>> 8);
public long getTotalRead() { try { return def.getTotalIn(); } catch (RuntimeException e) { // j2se 1.4.2_08 on linux is sometimes throwing an NPE in the getTotalIn() implementation return 0; } } public long getTotalCompressed() {
writeLong(out, currentEntry.crc = crc.getValue()); writeLong(out, currentEntry.compressedSize = def.getTotalOut()); writeLong(out, currentEntry.size = def.getTotalIn()); if (currentEntry.getMethod() == DEFLATED) { curOffset += writeLong(cDir, def.getTotalOut()); writeLong(cDir, def.getTotalIn()); } else { curOffset += writeLong(cDir, crc.tbytes);
int uncBytes = deflater.getTotalIn(); footer.writeByte(crcValue); footer.writeByte(crcValue >>> 8);
private ByteBuffer buildGzipFooter() { ByteBuffer b = ByteBuffer.allocate(8); b.order(ByteOrder.LITTLE_ENDIAN); b.putInt((int) (crc.getValue() & 0xFFFFFFFFL)); b.putInt(deflater.getTotalIn()); b.flip(); return b; }
private void _writeTrailer(OutputStream out) throws IOException { _putInt(_eightByteBuffer, 0, (int) _crc.getValue()); _putInt(_eightByteBuffer, 4, _deflater.getTotalIn()); out.write(_eightByteBuffer, 0, 8); }
private void _writeTrailer(OutputStream out) throws IOException { _putInt(_eightByteBuffer, 0, (int) _crc.getValue()); _putInt(_eightByteBuffer, 4, _deflater.getTotalIn()); out.write(_eightByteBuffer, 0, 8); }
private void _writeTrailer(OutputStream out) throws IOException { _putInt(_eightByteBuffer, 0, (int) _crc.getValue()); _putInt(_eightByteBuffer, 4, _deflater.getTotalIn()); out.write(_eightByteBuffer, 0, 8); }
/** re-implement because the relative method in jdk is invisible */ private void writeTrailer(byte[] paramArrayOfByte, int paramInt) throws IOException { writeInt((int)this.crc.getValue(), paramArrayOfByte, paramInt); writeInt(this.def.getTotalIn(), paramArrayOfByte, paramInt + 4); }
/** re-implement because the relative method in jdk is invisible */ private void writeTrailer(byte[] paramArrayOfByte, int paramInt) throws IOException { writeInt((int)this.crc.getValue(), paramArrayOfByte, paramInt); writeInt(this.def.getTotalIn(), paramArrayOfByte, paramInt + 4); }
private static String toDetail(Deflater deflater) { return String.format("Deflater[finished=%b,read=%d,written=%d,in=%d,out=%d]",deflater.finished(),deflater.getBytesRead(),deflater.getBytesWritten(), deflater.getTotalIn(),deflater.getTotalOut()); }
private void writeTrailer(final byte[] buf, final int offset) { writeInt((int) ((CheckedInputStream) in).getChecksum().getValue(), buf, offset); // CRC-32 of uncompr. data writeInt(compressor.getTotalIn(), buf, offset + 4); // Number of uncompr. bytes } }
/** * Create the GZIP trailer for the currently read and compressed data * * @throws IOException If an I/O error is produced. */ private void createTrailer() throws IOException { writeInt((int) ((CheckedInputStream) this.in).getChecksum().getValue(), GZIP_TRAILER, 0); // CRC-32 of uncompr. data writeInt(def.getTotalIn(), GZIP_TRAILER, 4); // Number of uncompr. bytes }