Java Integer to Byte intToByte(int i)

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

Description

int To Byte

License

BSD License

Declaration

public static byte intToByte(int i) 

Method Source Code

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

public class Main {
    public static byte intToByte(int i) {
        if (i < 255) {
            return (byte) (i & 0xFF);
        } else {/*from w w w  .  j a  v a  2 s  .c  o  m*/
            throw new NumberFormatException("Integer is more than 255 !");
        }
    }
}

Related

  1. intTo4Byte(int i)
  2. intToByte(byte[] buf, int off, int value)
  3. intToByte(final int i)
  4. intToByte(int i)
  5. IntToByte(int i)
  6. intToByte(int i)
  7. intToByte(int i_Value)
  8. intToByte(int myInt)
  9. intToByte(int num)