Here you can find the source of toRGB(byte r, byte g, byte b, byte a)
public static long toRGB(byte r, byte g, byte b, byte a)
//package com.java2s; //License from project: Open Source License public class Main { public static long toRGB(byte r, byte g, byte b, byte a) { long result = (int) r & 0xff; result |= ((int) g & 0xff) << 8; result |= ((int) b & 0xff) << 16; result |= ((int) a & 0xff) << 24; return result & 0xFFFFFFFFL; }//from w w w . j av a2s . c o m }