Java Long to Byte longToByte(long l)

Here you can find the source of longToByte(long l)

Description

long To Byte

License

LGPL

Declaration

public static Byte longToByte(long l) 

Method Source Code

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

public class Main {
    public static Byte longToByte(long l) {
        if (l >= Byte.MIN_VALUE && l <= Byte.MAX_VALUE) {
            return (byte) l;
        }/*from  w  w w. j a  v  a 2 s  . c  om*/
        return null;
    }

    public static byte longToByte(long l, byte defaultValue) {
        if (l >= Byte.MIN_VALUE && l <= Byte.MAX_VALUE) {
            return (byte) l;
        }
        return defaultValue;
    }
}

Related

  1. longToByte(long a_value)
  2. longToByte(long i)
  3. longToByte(long i_Value)
  4. longToByte(long l)
  5. longToByte(long l)
  6. longToByte(long number)
  7. longToByte(long value)
  8. longToByte(long x)
  9. longToByte(long[] values)