[
https://issues.apache.org/jira/browse/SLING-5730?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Simone Tripodi updated SLING-5730:
----------------------------------
Attachment: SLING-5730.patch
Please find in attachment an initial (prototypal) patch: it uses _Guava_'s
[FileBackedOutputStream|http://google.github.io/guava/releases/snapshot/api/docs/com/google/common/io/FileBackedOutputStream.html]
that, according to the javadoc, is a regular {{OutputStream}} implementation
that starts buffering to a byte array, but switches to file buffering once the
data reaches a configurable size.
The file threshold is fixed, at the moment, to {{128Kb}} as you suggested, but
if you could tell me where is the main configuration entry point, I can easily
adjust the patch in order to supply that feature as well.
TIA! :)
> Avoid creating a File of a package when it's small enough to fit in memory
> --------------------------------------------------------------------------
>
> Key: SLING-5730
> URL: https://issues.apache.org/jira/browse/SLING-5730
> Project: Sling
> Issue Type: Improvement
> Components: Distribution
> Reporter: Tommaso Teofili
> Assignee: Simone Tripodi
> Attachments: SLING-5730.patch
>
>
> {{ResourcePackageBuilder}} creates a temporary file holding the actual
> package stream, it'd be good to avoid that when the size of the stream is
> small enough to quickly fit into memory.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)