commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1307867 - /commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/ar/ArArchiveInputStream.java
Date Sat, 31 Mar 2012 18:21:29 GMT
Author: sebb
Date: Sat Mar 31 18:21:28 2012
New Revision: 1307867

URL: http://svn.apache.org/viewvc?rev=1307867&view=rev
Log:
COMPRESS-180 new String(byte[]) conversions use default encoding
Fixed ArArchiveInputStream

Modified:
    commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/ar/ArArchiveInputStream.java

Modified: commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/ar/ArArchiveInputStream.java
URL: http://svn.apache.org/viewvc/commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/ar/ArArchiveInputStream.java?rev=1307867&r1=1307866&r2=1307867&view=diff
==============================================================================
--- commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/ar/ArArchiveInputStream.java
(original)
+++ commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/ar/ArArchiveInputStream.java
Sat Mar 31 18:21:28 2012
@@ -190,7 +190,7 @@ public class ArArchiveInputStream extend
         throw new IOException("Failed to read entry: "+offset);
     }
     private long asLong(byte[] input) {
-        return Long.parseLong(new String(input).trim());
+        return Long.parseLong(ArchiveUtils.toAsciiString(input).trim());
     }
 
     private int asInt(byte[] input) {
@@ -206,7 +206,7 @@ public class ArArchiveInputStream extend
     }
 
     private int asInt(byte[] input, int base, boolean treatBlankAsZero) {
-        String string = new String(input).trim();
+        String string = ArchiveUtils.toAsciiString(input).trim();
         if (string.length() == 0 && treatBlankAsZero) {
             return 0;
         }



Mime
View raw message