Here you can find the source of c_memset(ByteBuffer b, int c_, int size)
public static ByteBuffer c_memset(ByteBuffer b, int c_, int size)
//package com.java2s; //License from project: Open Source License import java.nio.ByteBuffer; public class Main { public static ByteBuffer c_memset(ByteBuffer b, int c_, int size) { byte c = (byte) c_; ByteBuffer b2 = b.duplicate(); while (size-- != 0) { b2.put(c);//from w w w . jav a 2 s . c om } return b; } }