Java ByteBuffer Fill fillBuffer(ByteBuffer buffer, byte[] bytes)

Here you can find the source of fillBuffer(ByteBuffer buffer, byte[] bytes)

Description

fill Buffer

License

Open Source License

Parameter

Parameter Description
buffer a parameter
bytes a parameter

Declaration

public static Buffer fillBuffer(ByteBuffer buffer, byte[] bytes) 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.nio.Buffer;
import java.nio.ByteBuffer;

public class Main {
    /**/*from ww w.ja v  a 2  s.c  o m*/
     *
     * @param buffer
     * @param bytes
     * @return
     */
    public static Buffer fillBuffer(ByteBuffer buffer, byte[] bytes) {
        for (byte b : bytes) {
            buffer.put(b);
        }
        return buffer;
    }
}

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, int seed)
  5. fillBufFromTime(ByteBuffer buf, Calendar cal)
  6. fillDdsBuffer(ByteBuffer buf)
  7. fillHlaBuffer(ByteBuffer buf)