yakovsh commented on code in PR #441:
URL: https://github.com/apache/commons-compress/pull/441#discussion_r1402688746


##########
src/main/java/org/apache/commons/compress/archivers/cpio/CpioArchiveInputStream.java:
##########
@@ -362,7 +362,11 @@ public int read(final byte[] b, final int off, final int 
len) throws IOException
 
     private long readAsciiLong(final int length, final int radix) throws 
IOException {
         final byte[] tmpBuffer = readRange(length);
-        return Long.parseLong(ArchiveUtils.toAsciiString(tmpBuffer), radix);
+        try {

Review Comment:
   Should this be moved to a utility class like with ExactMath and wrapped with 
an IOException in that class? So maybe something like this:
   ```
       public static long parseLong(final String value) throws IOException {
           try {
               return Long.parseLong(value);
           } catch (final NumberFormatException exp) {
               throw new IOException("Unable to parse long from string value: " 
+ value);
           }
       }
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to