Here you can find the source of randomByteAsInt()
public static int randomByteAsInt()
//package com.java2s; //License from project: Open Source License public class Main { public static int randomByteAsInt() { return (int) (Math.random() * 0xFF); }//from ww w . j a v a 2 s . c om }