commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ggreg...@apache.org
Subject svn commit: r387356 - /jakarta/commons/proper/io/trunk/src/java/org/apache/commons/io/EndianUtils.java
Date Tue, 21 Mar 2006 00:21:20 GMT
Author: ggregory
Date: Mon Mar 20 16:21:17 2006
New Revision: 387356

URL: http://svn.apache.org/viewcvs?rev=387356&view=rev
Log:
Remove unnecessary casts from int to long.

Modified:
    jakarta/commons/proper/io/trunk/src/java/org/apache/commons/io/EndianUtils.java

Modified: jakarta/commons/proper/io/trunk/src/java/org/apache/commons/io/EndianUtils.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/io/trunk/src/java/org/apache/commons/io/EndianUtils.java?rev=387356&r1=387355&r2=387356&view=diff
==============================================================================
--- jakarta/commons/proper/io/trunk/src/java/org/apache/commons/io/EndianUtils.java (original)
+++ jakarta/commons/proper/io/trunk/src/java/org/apache/commons/io/EndianUtils.java Mon Mar
20 16:21:17 2006
@@ -181,7 +181,7 @@
      * @return the value read
      */
     public static long readSwappedUnsignedInteger(byte[] data, int offset) {
-        return (long)( ( ( data[ offset + 0 ] & 0xff ) << 0 ) +
+        return ( ( ( data[ offset + 0 ] & 0xff ) << 0 ) +
             ( ( data[ offset + 1 ] & 0xff ) << 8 ) +
             ( ( data[ offset + 2 ] & 0xff ) << 16 ) +
             ( ( data[ offset + 3 ] & 0xff ) << 24 ) );
@@ -213,16 +213,16 @@
      * @return the value read
      */
     public static long readSwappedLong(byte[] data, int offset) {
-        long low = (long)(
+        long low = 
             ( ( data[ offset + 0 ] & 0xff ) << 0 ) +
             ( ( data[ offset + 1 ] & 0xff ) << 8 ) +
             ( ( data[ offset + 2 ] & 0xff ) << 16 ) +
-            ( ( data[ offset + 3 ] & 0xff ) << 24 ) );
-        long high = (long)(
+            ( ( data[ offset + 3 ] & 0xff ) << 24 );
+        long high = 
             ( ( data[ offset + 4 ] & 0xff ) << 0 ) +
             ( ( data[ offset + 5 ] & 0xff ) << 8 ) +
             ( ( data[ offset + 6 ] & 0xff ) << 16 ) +
-            ( ( data[ offset + 7 ] & 0xff ) << 24 ) );
+            ( ( data[ offset + 7 ] & 0xff ) << 24 );
         return low + (high << 32);
     }
 
@@ -346,10 +346,10 @@
         int value3 = read( input );
         int value4 = read( input );
 
-        return ( ( ( value1 & 0xff ) << 0 ) +
+        return ( ( value1 & 0xff ) << 0 ) +
             ( ( value2 & 0xff ) << 8 ) +
             ( ( value3 & 0xff ) << 16 ) +
-            ( ( value4 & 0xff ) << 24 ) );
+            ( ( value4 & 0xff ) << 24 );
     }
 
     /**
@@ -367,10 +367,10 @@
         int value3 = read( input );
         int value4 = read( input );
 
-        return (long)( ( ( value1 & 0xff ) << 0 ) +
+        return ( ( value1 & 0xff ) << 0 ) +
             ( ( value2 & 0xff ) << 8 ) +
             ( ( value3 & 0xff ) << 16 ) +
-            ( ( value4 & 0xff ) << 24 ) );
+            ( ( value4 & 0xff ) << 24 );
     }
 
     /**



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message