Java Random Byte randByte()

Here you can find the source of randByte()

Description

rand Byte

License

Mozilla Public License

Declaration

public static byte randByte() 

Method Source Code

//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);
    }
}

Related

  1. rand(int lo, int hi)
  2. rand(int lo, int hi)
  3. rand(int lo, int hi)
  4. Rand(int lo, int hi)
  5. rand(int max)
  6. randomByte()