COMPRESS-407 make changed defaults more explicit
Project: http://git-wip-us.apache.org/repos/asf/commons-compress/repo Commit: http://git-wip-us.apache.org/repos/asf/commons-compress/commit/49f65470 Tree: http://git-wip-us.apache.org/repos/asf/commons-compress/tree/49f65470 Diff: http://git-wip-us.apache.org/repos/asf/commons-compress/diff/49f65470 Branch: refs/heads/master Commit: 49f6547038ca5e0c9aed0db061dff518cfaf240e Parents: 220c45d Author: Stefan Bodewig <bode...@apache.org> Authored: Thu Jan 11 08:25:12 2018 +0100 Committer: Stefan Bodewig <bode...@apache.org> Committed: Thu Jan 11 08:25:12 2018 +0100 ---------------------------------------------------------------------- src/changes/changes.xml | 3 +++ .../compress/archivers/tar/TarArchiveOutputStream.java | 13 +++++++++++++ 2 files changed, 16 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/commons-compress/blob/49f65470/src/changes/changes.xml ---------------------------------------------------------------------- diff --git a/src/changes/changes.xml b/src/changes/changes.xml index 382751e..1fdf5de 100644 --- a/src/changes/changes.xml +++ b/src/changes/changes.xml @@ -141,6 +141,9 @@ wanted to create such files."> specified at construction time are compatible with the tar specification. In particular 512 is the only record size accepted and the block size must be a multiple of 512. + At the same time the default block size in + TarArchiveOutputStream has been changed from 10240 to 512 + bytes. </action> <action issue="COMPRESS-400" type="add" date="2017-06-26" due-to="Simon Spero "> http://git-wip-us.apache.org/repos/asf/commons-compress/blob/49f65470/src/main/java/org/apache/commons/compress/archivers/tar/TarArchiveOutputStream.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/commons/compress/archivers/tar/TarArchiveOutputStream.java b/src/main/java/org/apache/commons/compress/archivers/tar/TarArchiveOutputStream.java index 940ca48..b7f4350 100644 --- a/src/main/java/org/apache/commons/compress/archivers/tar/TarArchiveOutputStream.java +++ b/src/main/java/org/apache/commons/compress/archivers/tar/TarArchiveOutputStream.java @@ -40,6 +40,15 @@ import org.apache.commons.compress.utils.FixedLengthBlockOutputStream; * The TarOutputStream writes a UNIX tar archive as an OutputStream. Methods are provided to put * entries, and then write their contents by writing to this stream using write(). * + * <p>tar archives consist of a sequence of records of 512 bytes each + * that are grouped into blocks. Prior to Apache Commons Compress 1.14 + * it has been possible to configure a record size different from 512 + * bytes and arbitrary block sizes. Starting with Compress 1.15 512 is + * the only valid option for the record size and the block size must + * be a multiple of 512. Also the default block size changed from + * 10240 bytes prior to Compress 1.15 to 512 bytes with Compress + * 1.15.</p> + * * @NotThreadSafe */ public class TarArchiveOutputStream extends ArchiveOutputStream { @@ -118,6 +127,8 @@ public class TarArchiveOutputStream extends ArchiveOutputStream { /** * Constructor for TarArchiveOutputStream. * + * <p>Uses a block size of 512 bytes.</p> + * * @param os the output stream to use */ public TarArchiveOutputStream(final OutputStream os) { @@ -127,6 +138,8 @@ public class TarArchiveOutputStream extends ArchiveOutputStream { /** * Constructor for TarArchiveOutputStream. * + * <p>Uses a block size of 512 bytes.</p> + * * @param os the output stream to use * @param encoding name of the encoding to use for file names * @since 1.4