Here you can find the source of randByte()
public static byte randByte()
//package com.java2s; /**//www . ja va 2 s. c o m * Copyright 2015 Michael Leahy / TyphonRT, Inc. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ public class Main { private static final int s_RAND_MAX = 64000; public static byte randByte() { return (byte) ((int) (Math.random() * s_RAND_MAX) & 0xff); } }