Java Integer to Byte intToByte(int i)

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

Description

int To Byte

License

LGPL

Declaration

public static Byte intToByte(int i) 

Method Source Code

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

public class Main {
    public static Byte intToByte(int i) {
        if (i >= Byte.MIN_VALUE && i <= Byte.MAX_VALUE) {
            return (byte) i;
        }/*  w  w  w. j a  v a  2 s. c  o  m*/
        return null;
    }

    public static byte intToByte(int i, byte defaultValue) {
        if (i >= Byte.MIN_VALUE && i <= Byte.MAX_VALUE) {
            return (byte) i;
        }
        return defaultValue;
    }
}

Related

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