Example usage for org.apache.commons.compress.archivers.jar JarArchiveEntry setCompressedSize

List of usage examples for org.apache.commons.compress.archivers.jar JarArchiveEntry setCompressedSize

Introduction

In this page you can find the example usage for org.apache.commons.compress.archivers.jar JarArchiveEntry setCompressedSize.

Prototype

public void setCompressedSize(long csize) 

Source Link

Document

Sets the size of the compressed entry data.

Usage

From source file:org.springframework.boot.loader.tools.JarWriter.java

private void setUpEntry(JarFile jarFile, JarArchiveEntry entry) throws IOException {
    try (ZipHeaderPeekInputStream inputStream = new ZipHeaderPeekInputStream(jarFile.getInputStream(entry))) {
        if (inputStream.hasZipHeader() && entry.getMethod() != ZipEntry.STORED) {
            new CrcAndSize(inputStream).setupStoredEntry(entry);
        } else {//  w ww  . j  a v  a 2 s. co  m
            entry.setCompressedSize(-1);
        }
    }
}