Java ByteBuffer Fill fillBuffer(ByteBuffer buffer, int seed)

Here you can find the source of fillBuffer(ByteBuffer buffer, int seed)

Description

fill Buffer

License

Open Source License

Declaration

public static final void fillBuffer(ByteBuffer buffer, int seed) 

Method Source Code


//package com.java2s;
import java.nio.ByteBuffer;
import java.util.Random;

public class Main {
    public static final void fillBuffer(ByteBuffer buffer, int seed) {

        Random rnd = new Random(seed);

        while (buffer.remaining() != 0)
            buffer.putInt(rnd.nextInt());

        buffer.rewind();/* w ww . j  a  v a 2  s .c  o m*/
    }
}

Related

  1. fill(ByteBuffer buffer, int off, int len, byte val)
  2. fill(ByteBuffer buffer, int position, int length, byte filler)
  3. fill(ByteBuffer to, byte[] b, int off, int len)
  4. fillBuffer(ByteBuffer buffer, byte[] bytes)
  5. fillBufFromTime(ByteBuffer buf, Calendar cal)
  6. fillDdsBuffer(ByteBuffer buf)
  7. fillHlaBuffer(ByteBuffer buf)
  8. fillRange(ByteBuffer buffer, int start, int end)