Java ByteBuffer Set c_memset(ByteBuffer b, int c_, int size)

Here you can find the source of c_memset(ByteBuffer b, int c_, int size)

Description

memset

License

Open Source License

Declaration

public static ByteBuffer c_memset(ByteBuffer b, int c_, int size) 

Method Source Code

//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;
    }
}

Related

  1. arrayCopy(ByteBuffer buffer, int position, byte[] bytes, int offset, int length)
  2. base64FormatOfBinarySet(Collection bs)
  3. blockCopy(ByteBuffer source, int srcOffset, byte[] dest, int destOffset, int count)
  4. byteBuffersToString(ByteBuffer[] bufs, Charset cs)
  5. byteIndexOf(ByteBuffer buffer, byte[] temp, int offset)
  6. charSequence2ByteBuffer(CharSequence cs, Charset charset)
  7. charstoUTF8Bytes(char[] srcBuf, int srcOffset, int srcLength, ByteBuffer dest, int destOffset)
  8. equals(final ByteBuffer keyValue, final int offset, final int keyLen, final byte[] otherKey)
  9. find(ByteBuffer buffer, int offset, byte searchKey)