Java ByteBuffer Extract extractBytes(ByteBuffer buffer, int size)

Here you can find the source of extractBytes(ByteBuffer buffer, int size)

Description

extract Bytes

License

Creative Commons License

Parameter

Parameter Description
buffer a parameter
size a parameter

Declaration

public static byte[] extractBytes(ByteBuffer buffer, int size) 

Method Source Code

//package com.java2s;
//License from project: Creative Commons License 

import java.nio.ByteBuffer;

public class Main {
    /**//from   ww  w  .j a  va 2 s . c om
     * 
     * @param buffer
     * @param size
     * @return
     */
    public static byte[] extractBytes(ByteBuffer buffer, int size) {
        byte[] result = new byte[size];
        for (int i = 0; i < size; i++) {
            result[i] = buffer.get();
        }
        return result;
    }
}

Related

  1. extract(ByteBuffer buf)
  2. extractBytes(ByteBuffer buf)
  3. extractBytes(ByteBuffer byteBuffer, byte startByte, byte endByte)
  4. extractSingleHighCardDims(byte[] highCardArr, int index, int highCardinalityCount, ByteBuffer outBuffer)