You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gr...@apache.org on 2009/04/23 07:55:48 UTC
svn commit: r767812 -
/commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/tar/TarArchiveOutputStream.java
Author: grobmeier
Date: Thu Apr 23 05:55:48 2009
New Revision: 767812
URL: http://svn.apache.org/viewvc?rev=767812&view=rev
Log:
COMPRESS-63: fields are stored in ASCII
Modified:
commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/tar/TarArchiveOutputStream.java
Modified: commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/tar/TarArchiveOutputStream.java
URL: http://svn.apache.org/viewvc/commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/tar/TarArchiveOutputStream.java?rev=767812&r1=767811&r2=767812&view=diff
==============================================================================
--- commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/tar/TarArchiveOutputStream.java (original)
+++ commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/tar/TarArchiveOutputStream.java Thu Apr 23 05:55:48 2009
@@ -23,6 +23,7 @@
import java.io.OutputStream;
import org.apache.commons.compress.archivers.ArchiveEntry;
import org.apache.commons.compress.archivers.ArchiveOutputStream;
+import org.apache.commons.compress.utils.ArchiveUtils;
/**
* The TarOutputStream writes a UNIX tar archive as an OutputStream.
@@ -161,7 +162,7 @@
TarArchiveEntry longLinkEntry = new TarArchiveEntry(TarConstants.GNU_LONGLINK,
TarConstants.LF_GNUTYPE_LONGNAME);
- final byte[] nameBytes = entry.getName().getBytes(); // TODO is it correct to use the default charset here?
+ final byte[] nameBytes = ArchiveUtils.toAsciiBytes(entry.getName());
longLinkEntry.setSize(nameBytes.length + 1); // +1 for NUL
putArchiveEntry(longLinkEntry);
write(nameBytes);