Skip to content

Commit 1d776e8

Browse files
committed
Remove unnecessary casts from int to int.
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/io/trunk@387353 13f79535-47bb-0310-9956-ffa450edef68
1 parent b828e78 commit 1d776e8

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

src/java/org/apache/commons/io/EndianUtils.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ public static short readSwappedShort(byte[] data, int offset) {
140140
* @return the value read
141141
*/
142142
public static int readSwappedUnsignedShort(byte[] data, int offset) {
143-
return (int)( ( ( data[ offset + 0 ] & 0xff ) << 0 ) +
143+
return ( ( ( data[ offset + 0 ] & 0xff ) << 0 ) +
144144
( ( data[ offset + 1 ] & 0xff ) << 8 ) );
145145
}
146146

@@ -166,7 +166,7 @@ public static void writeSwappedInteger(byte[] data, int offset, int value) {
166166
* @return the value read
167167
*/
168168
public static int readSwappedInteger(byte[] data, int offset) {
169-
return (int)( ( ( data[ offset + 0 ] & 0xff ) << 0 ) +
169+
return ( ( ( data[ offset + 0 ] & 0xff ) << 0 ) +
170170
( ( data[ offset + 1 ] & 0xff ) << 8 ) +
171171
( ( data[ offset + 2 ] & 0xff ) << 16 ) +
172172
( ( data[ offset + 3 ] & 0xff ) << 24 ) );
@@ -311,7 +311,7 @@ public static int readSwappedUnsignedShort(InputStream input)
311311
int value1 = read( input );
312312
int value2 = read( input );
313313

314-
return (int)( ( ( value1 & 0xff ) << 0 ) +
314+
return ( ( ( value1 & 0xff ) << 0 ) +
315315
( ( value2 & 0xff ) << 8 ) );
316316
}
317317

@@ -346,7 +346,7 @@ public static int readSwappedInteger(InputStream input)
346346
int value3 = read( input );
347347
int value4 = read( input );
348348

349-
return (int)( ( ( value1 & 0xff ) << 0 ) +
349+
return ( ( ( value1 & 0xff ) << 0 ) +
350350
( ( value2 & 0xff ) << 8 ) +
351351
( ( value3 & 0xff ) << 16 ) +
352352
( ( value4 & 0xff ) << 24 ) );

0 commit comments

Comments
 (0)