Sha256: d0319fcebd7054332ab746b4f6e30d6471a99643275f1cc8554506529a0bcfb8

Contents?: true

Size: 709 Bytes

Versions: 119

Compression:

Stored size: 709 Bytes

Contents

package j2me.util;

import java.util.Random;

public class RandomMe {
    private static final int BITS_PER_BYTE = 8;
    private static final int BYTES_PER_INT = 4;

    public static void nextBytes(Random rndThis, byte[] bytes) {
        int numRequested = bytes.length;

        int numGot = 0, rnd = 0;

        while (true) {
            for (int i = 0; i < BYTES_PER_INT; i++) {
                if (numGot == numRequested)
                    return;

                //TODO: rndThis.next
                rnd = (i==0 ? 0/*rndThis.next(BITS_PER_BYTE * BYTES_PER_INT)*/
                            : rnd >> BITS_PER_BYTE);
                bytes[numGot++] = (byte)rnd;
            }
        }
    }
    
}

Version data entries

119 entries across 119 versions & 1 rubygems

Version Path
rhodes-3.5.1.12 platform/bb/RubyVM/src/j2me/util/RandomMe.java
rhodes-3.3.5 platform/bb/RubyVM/src/j2me/util/RandomMe.java
rhodes-3.4.2 platform/bb/RubyVM/src/j2me/util/RandomMe.java
rhodes-3.3.4 platform/bb/RubyVM/src/j2me/util/RandomMe.java
rhodes-3.3.3 platform/bb/RubyVM/src/j2me/util/RandomMe.java
rhodes-3.3.3.beta.4 platform/bb/RubyVM/src/j2me/util/RandomMe.java
rhodes-3.3.3.beta.3 platform/bb/RubyVM/src/j2me/util/RandomMe.java
rhodes-3.3.3.beta.2 platform/bb/RubyVM/src/j2me/util/RandomMe.java
rhodes-3.3.3.beta.1 platform/bb/RubyVM/src/j2me/util/RandomMe.java
rhodes-3.3.2 platform/bb/RubyVM/src/j2me/util/RandomMe.java
rhodes-3.3.2.beta.7 platform/bb/RubyVM/src/j2me/util/RandomMe.java
rhodes-3.3.2.beta.6 platform/bb/RubyVM/src/j2me/util/RandomMe.java
rhodes-3.3.2.beta.5 platform/bb/RubyVM/src/j2me/util/RandomMe.java
rhodes-3.3.2.beta.4 platform/bb/RubyVM/src/j2me/util/RandomMe.java
rhodes-3.3.2.beta.3 platform/bb/RubyVM/src/j2me/util/RandomMe.java
rhodes-3.3.2.beta.2 platform/bb/RubyVM/src/j2me/util/RandomMe.java
rhodes-3.3.2.beta.1 platform/bb/RubyVM/src/j2me/util/RandomMe.java
rhodes-3.3.1 platform/bb/RubyVM/src/j2me/util/RandomMe.java
rhodes-3.3.0 platform/bb/RubyVM/src/j2me/util/RandomMe.java
rhodes-3.3.0.beta.3 platform/bb/RubyVM/src/j2me/util/RandomMe.java