Here you can find the source of extractBytes(ByteBuffer buf)
public static byte[] extractBytes(ByteBuffer buf)
//package com.java2s; //License from project: Open Source License import java.nio.ByteBuffer; public class Main { public static byte[] extractBytes(ByteBuffer buf) { byte[] ret = new byte[buf.limit()]; buf.get(ret);//from ww w. j a va2 s.c o m return ret; } }