Java tutorial
//package com.java2s; import java.util.Random; public class Main { /** * Generate the random byte to be sent * * @return the random byte */ private static byte randomByte() { return (byte) (127 - new Random().nextInt(256)); } }