Commons Compress
  1. Commons Compress
  2. COMPRESS-48

[compress] add a memory efficient stream compress InputStream - e.g. a "DeflaterInputStream"


    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
    • Environment:

      Operating System: All
      Platform: Other


      Assume from a struts-tomcate web-app I get a large file that I want to store in
      a DB. To save DB permanent storage, I want to compress this. To be portable, I
      rather want to do that in java than on the DB-side with some proprietary commands.

      In order not to have to load into the RAM at least the entire compressed output
      by e.g. creating a ByteArrayOutputStream with for example or and then
      converting it back to an InputStream for the PreparedStatement
      stmt.setBinaryStream(int pos,
      InputStream stream, int length), I envision an InputStream converter that is
      memory efficient.

      I started implementing it myself and got it working at least for
      single-byte reads. But it is far from production-readiness - perhaps I should
      rather extend than trying to do my own efficient
      buffer management and do all the synchronize() blocking etc.
      ==> shouldn't something go into

      There are certainly other applications for such a class.

      P.S.: Alternatively, there is a "OutputStream java.sql.Blob.setBinaryStream(long
      pos)" but for example in MySQL that "updatable BLOB that can update in-place" is
      not yet implemented. Doing proprietary SQL-"COMPRESS" as per is probably an even less
      preferrable option.


        Ralf Hauser created issue -
        Ralf Hauser added a comment -

        see also COM-2359 and COM-2360

        Ralf Hauser added a comment - see also COM-2359 and COM-2360
        Ralf Hauser added a comment -
        Ralf Hauser added a comment - see also
        Henri Yandell made changes -
        Field Original Value New Value
        issue.field.bugzillaimportkey 35028 12342256
        Henri Yandell made changes -
        Project Commons [ 12310458 ] Commons Sandbox [ 12310491 ]
        Assignee Jakarta Commons Developers Mailing List [ ]
        Affects Version/s unspecified [ 12311647 ]
        Key COM-2104 SANDBOX-129
        Component/s Sandbox [ 12311131 ]
        Henri Yandell made changes -
        Component/s Compress [ 12311183 ]
        Torsten Curdt added a comment -

        Should be exactly was trunk provides.

        Torsten Curdt added a comment - Should be exactly was trunk provides.
        Torsten Curdt made changes -
        Resolution Fixed [ 1 ]
        Status Open [ 1 ] Closed [ 6 ]
        Assignee Torsten Curdt [ tcurdt ]
        Dennis Lundberg made changes -
        Project Commons Sandbox [ 12310491 ] Commons Compress [ 12310904 ]
        Key SANDBOX-129 COMPRESS-48
        Component/s Compress [ 12311183 ]
        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open Closed Closed
        1324d 11h 10m 1 Torsten Curdt 07/Jan/09 13:39


          • Assignee:
            Torsten Curdt
            Ralf Hauser
          • Votes:
            0 Vote for this issue
            0 Start watching this issue


            • Created: