FileDocCategorySizeDatePackage
RandomInputStream.javaAPI DocExample764Sun Mar 28 07:23:48 BST 1999com.macfaq.io

RandomInputStream

public class RandomInputStream extends InputStream

Fields Summary
private transient Random
generator
Constructors Summary
Methods Summary
public intread()


     

    return generator.nextInt() % 256;

  
public intread(byte[] data, int offset, int length)


    byte[] temp = new byte[length];
    generator.nextBytes(temp);
    System.arraycopy(temp, 0, data, offset, length);
    return length;

  
public intread(byte[] data)


    generator.nextBytes(data);
    return data.length;

  
public longskip(long bytesToSkip)

  
    // It's all random so skipping has no effect
    return bytesToSkip;