Java ByteBuffer from Byte Array readByteArray(ByteBuffer byteBuffer, int length)

Here you can find the source of readByteArray(ByteBuffer byteBuffer, int length)

Description

read Byte Array

License

Open Source License

Declaration

public static byte[] readByteArray(ByteBuffer byteBuffer, int length) 

Method Source Code


//package com.java2s;
/*//from   w w w .  j a  va  2s . c om
 * (C) 2007-2010 Alibaba Group Holding Limited.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 as
 * published by the Free Software Foundation.
 *
 */

import java.nio.ByteBuffer;

public class Main {
    public static byte[] readByteArray(ByteBuffer byteBuffer, int length) {
        byte[] ret = new byte[length];
        byteBuffer.get(ret, 0, length);
        return ret;
    }
}

Related

  1. asByteBuffer(byte... arguments)
  2. buffer2Bytes(ByteBuffer bbuf)
  3. bufToArray(ByteBuffer b)
  4. bufToArray(ByteBuffer b)
  5. byteBuffer(byte[] a)
  6. readByteArray(ByteBuffer in)
  7. readByteArray(ByteBuffer logBuf)
  8. readByteAsInt(ByteBuffer buffer)
  9. readBytes(ByteBuffer bb, int length)