Java Number Swap swapLong(long value)

Here you can find the source of swapLong(long value)

Description

Converts a "long" value between endian systems.

License

Open Source License

Declaration

static public long swapLong(long value) 

Method Source Code

//package com.java2s;

public class Main {
    /** Converts a "long" value between endian systems. */
    static public long swapLong(long value) {
        return (((value >> 0) & 0xff) << 56) | (((value >> 8) & 0xff) << 48) | (((value >> 16) & 0xff) << 40)
                | (((value >> 24) & 0xff) << 32) | (((value >> 32) & 0xff) << 24) | (((value >> 40) & 0xff) << 16)
                | (((value >> 48) & 0xff) << 8) | (((value >> 56) & 0xff) << 0);
    }/*w w w .  j av  a 2s .  c o m*/
}

Related

  1. swapFloat(float value)
  2. swapInt(int i)
  3. swapInt(int i)
  4. swapInteger(int integer)
  5. swapLong(long value)
  6. swapLong(long value)
  7. swapShort(final short value)
  8. swapShort(short value)
  9. swapShort(short value)