Java ByteBuffer Fill fill(ByteBuffer buffer, int off, int len, byte val)

Here you can find the source of fill(ByteBuffer buffer, int off, int len, byte val)

Description

fill

License

Open Source License

Declaration

public static void fill(ByteBuffer buffer, int off, int len, byte val) 

Method Source Code


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

public class Main {
    public static void fill(ByteBuffer buffer, int off, int len, byte val) {
        buffer.position(off);/*from  w ww .  ja  v a  2 s  .c  o m*/
        while (--len >= 0)
            buffer.put(val);
    }
}

Related

  1. fill(ByteBuffer buffer, int position, int length, byte filler)
  2. fill(ByteBuffer to, byte[] b, int off, int len)
  3. fillBuffer(ByteBuffer buffer, byte[] bytes)
  4. fillBuffer(ByteBuffer buffer, int seed)