elharo opened a new pull request, #566:
URL: https://github.com/apache/commons-io/pull/566

   Most of the methods in this class are badly named. Except for the swap 
method they all just read and write in little endian order. E.g. consider 
readSwappedInteger
   
   ```
       public static int readSwappedInteger(final InputStream input) throws 
IOException {
           final int value1 = read(input);
           final int value2 = read(input);
           final int value3 = read(input);
           final int value4 = read(input);
           return ((value1 & 0xff) << 0) + ((value2 & 0xff) << 8) + ((value3 & 
0xff) << 16) + ((value4 & 0xff) << 24);
       }
   ```
   
   This always reads four bytes from an input stream and always considers the 
first byte read to be the least significant. It would have been better named 
readLittleEndianInteger.
   
   I'm tempted to deprecate the whole thing and replace it with something 
better named, but for now at least let's correct the Java doc. 
   
   @garydgregory 


-- 
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