Java Number Swap swapInt(int i)

Here you can find the source of swapInt(int i)

Description

Converts an "int" value between endian systems.

License

Open Source License

Declaration

static public int swapInt(int i) 

Method Source Code

//package com.java2s;

public class Main {
    /** Converts an "int" value between endian systems. */
    static public int swapInt(int i) {
        return ((i & 0xFF) << 24) | ((i & 0xFF00) << 8) | ((i & 0xFF0000) >> 8) | ((i >> 24) & 0xFF);
    }//  w  ww  .  j  a  v a  2s.  c  o  m
}

Related

  1. swapCasing(String str)
  2. swapDouble(double value)
  3. swapDouble(double value)
  4. swapFloat(float floatValue)
  5. swapFloat(float value)
  6. swapInt(int i)
  7. swapInteger(int integer)
  8. swapLong(long value)
  9. swapLong(long value)