[jira] [Commented] (JCRVLT-163) Avoid compressing incompressible binaries

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

[jira] [Commented] (JCRVLT-163) Avoid compressing incompressible binaries

JIRA jira@apache.org

    [ https://issues.apache.org/jira/browse/JCRVLT-163?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16032688#comment-16032688 ]

Tobias Bocanegra commented on JCRVLT-163:

optimize your test output stream, by also overriding the other write() methods:

    public class WriteCountOutputStream extends OutputStream {

        long size = 0;

        public void write(int b) throws IOException {

        public void write(byte[] b) throws IOException {
            size+= b.length;

        public void write(byte[] b, int off, int len) throws IOException {
            size+= len;

        public long size() {
            return size;

> Avoid compressing incompressible binaries
> -----------------------------------------
>                 Key: JCRVLT-163
>                 URL: https://issues.apache.org/jira/browse/JCRVLT-163
>             Project: Jackrabbit FileVault
>          Issue Type: Improvement
>          Components: Packaging
>    Affects Versions: 3.0
>            Reporter: Timothee Maret
>             Fix For: 3.1.40
>         Attachments: JCRVLT-163.patch
> As discussed in [0], this issue tracks allowing to specify the compression level when building packages. The primary idea is to avoid compressing (compression level = {{NO_COMPRESSION}})  already compressed binaries, identified based on their MIME type.
> Setting the compression level is a tradeoff between the compression speed and the size of the compressed artefacts.
> Different use cases likely favour maximising either of the two.
> Therefor, it may make sense to allow configuring the compression levels per use case (not globally).
> A generic way to express this configuration would be:
> * a mapping from MIME type to compression level
> * the default level (for MIME type not matching any entry in the mapping)
> [0] https://www.mail-archive.com/dev@.../msg37807.html

This message was sent by Atlassian JIRA