Java Integer to intToUnsignedShort(int value)

Here you can find the source of intToUnsignedShort(int value)

Description

int To Unsigned Short

License

Apache License

Declaration

public static final byte[] intToUnsignedShort(int value) throws NumberFormatException 

Method Source Code

//package com.java2s;
//License from project: Apache License 

public class Main {
    public static final byte[] intToUnsignedShort(int value) throws NumberFormatException {
        byte[] ret = new byte[2];
        ret[0] = (byte) ((value & 0xff00) >>> 8);
        ret[1] = (byte) (value & 0xff);
        return ret;
    }/*from  www. j  a v  a2 s .com*/
}

Related

  1. intToULong(int signed)
  2. intToUnsigned(int signed)
  3. intToUnsignedByte(int i)
  4. intToUnsignedInt(int data)
  5. intToUnsignedLong(int data)
  6. intToWeb(int color)
  7. intToZigZag(final int n)