Here you can find the source of getBytes(ByteBuffer buf, byte[] arr)
Parameter | Description |
---|---|
buf | a parameter |
arr | a parameter |
public static boolean getBytes(ByteBuffer buf, byte[] arr)
//package com.java2s; //License from project: Open Source License import java.nio.ByteBuffer; public class Main { /**/* w ww . java 2 s .c o m*/ * Retrieves arr.length bytes from ByteBuffer * @param buf * @param arr * @return whether the BB.get() operation was successful or not */ public static boolean getBytes(ByteBuffer buf, byte[] arr) { if (buf.remaining() < arr.length) return false; buf.get(arr); return true; } }