commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject svn commit: r1570253 - in /commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/compressors/gzip: GzipCompressorInputStream.java GzipCompressorOutputStream.java
Date Thu, 20 Feb 2014 16:12:37 GMT
Author: bodewig
Date: Thu Feb 20 16:12:37 2014
New Revision: 1570253

URL: http://svn.apache.org/r1570253
Log:
magic strings

Modified:
    commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/compressors/gzip/GzipCompressorInputStream.java
    commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/compressors/gzip/GzipCompressorOutputStream.java

Modified: commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/compressors/gzip/GzipCompressorInputStream.java
URL: http://svn.apache.org/viewvc/commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/compressors/gzip/GzipCompressorInputStream.java?rev=1570253&r1=1570252&r2=1570253&view=diff
==============================================================================
--- commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/compressors/gzip/GzipCompressorInputStream.java
(original)
+++ commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/compressors/gzip/GzipCompressorInputStream.java
Thu Feb 20 16:12:37 2014
@@ -30,6 +30,7 @@ import java.util.zip.Inflater;
 import java.util.zip.CRC32;
 
 import org.apache.commons.compress.compressors.CompressorInputStream;
+import org.apache.commons.compress.utils.CharsetNames;
 
 /**
  * Input stream that decompresses .gz files.
@@ -208,12 +209,14 @@ public class GzipCompressorInputStream e
 
         // Original file name
         if ((flg & FNAME) != 0) {
-            parameters.setFilename(new String(readToNull(inData), "ISO-8859-1"));
+            parameters.setFilename(new String(readToNull(inData),
+                                              CharsetNames.ISO_8859_1));
         }
 
         // Comment
         if ((flg & FCOMMENT) != 0) {
-            parameters.setComment(new String(readToNull(inData), "ISO-8859-1"));
+            parameters.setComment(new String(readToNull(inData),
+                                             CharsetNames.ISO_8859_1));
         }
 
         // Header "CRC16" which is actually a truncated CRC32 (which isn't

Modified: commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/compressors/gzip/GzipCompressorOutputStream.java
URL: http://svn.apache.org/viewvc/commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/compressors/gzip/GzipCompressorOutputStream.java?rev=1570253&r1=1570252&r2=1570253&view=diff
==============================================================================
--- commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/compressors/gzip/GzipCompressorOutputStream.java
(original)
+++ commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/compressors/gzip/GzipCompressorOutputStream.java
Thu Feb 20 16:12:37 2014
@@ -28,6 +28,7 @@ import java.util.zip.GZIPInputStream;
 import java.util.zip.GZIPOutputStream;
 
 import org.apache.commons.compress.compressors.CompressorOutputStream;
+import org.apache.commons.compress.utils.CharsetNames;
 
 /**
  * Compressed output stream using the gzip format. This implementation improves
@@ -105,12 +106,12 @@ public class GzipCompressorOutputStream 
         out.write(buffer.array());
         
         if (filename != null) {
-            out.write(filename.getBytes("ISO-8859-1"));
+            out.write(filename.getBytes(CharsetNames.ISO_8859_1));
             out.write(0);
         }
         
         if (comment != null) {
-            out.write(comment.getBytes("ISO-8859-1"));
+            out.write(comment.getBytes(CharsetNames.ISO_8859_1));
             out.write(0);
         }
     }



Mime
View raw message