Here you can find the source of intToByte(int number)
Parameter | Description |
---|---|
number | int number |
public static byte intToByte(int number)
//package com.java2s; //License from project: Open Source License public class Main { /**/*from w w w . ja v a 2s. c o m*/ * Converts a int to a byte. * * @param number int number * @return byte of the int */ public static byte intToByte(int number) { if (number <= 255 && number > 0) return (byte) number; else return Byte.MIN_VALUE; } }