Android Int Bit Shift flip16(int num)

Here you can find the source of flip16(int num)

Description

for switching big/small endian

Parameter

Parameter Description
num a parameter

Return

filpped representation.

Declaration

public static int flip16(int num) 

Method Source Code

//package com.java2s;

public class Main {
    /**//from  w  w w .j av a 2  s .c o m
     * for switching big/small endian
     * @param num
     * @return filpped representation. 
     */
    public static int flip16(int num) {
        int tmp = num;

        tmp = ((tmp & 0x00FF) << 8) + ((tmp & 0xFF00) >> 8);
        return tmp;
    }
}

Related

  1. nextPowerOf2(int n)
  2. toByta(int data)
  3. swapBytes(int value)
  4. swap(int x)