Here you can find the source of extractBytes(ByteBuffer buffer, int size)
Parameter | Description |
---|---|
buffer | a parameter |
size | a parameter |
public static byte[] extractBytes(ByteBuffer buffer, int size)
//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; } }