Here you can find the source of getJceBufArray(ByteBuffer buffer)
public static byte[] getJceBufArray(ByteBuffer buffer)
//package com.java2s; //License from project: Open Source License import java.nio.ByteBuffer; public class Main { public static byte[] getJceBufArray(ByteBuffer buffer) { byte[] arrayOfByte = new byte[buffer.position()]; System.arraycopy(buffer.array(), 0, arrayOfByte, 0, arrayOfByte.length);/*from www.ja va 2 s . c om*/ return arrayOfByte; } }