Java ByteBuffer from Byte Array readBytes(ByteBuffer buffer, int length)

Here you can find the source of readBytes(ByteBuffer buffer, int length)

Description

read Bytes

License

Apache License

Declaration

public static byte[] readBytes(ByteBuffer buffer, int length) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.nio.ByteBuffer;

public class Main {
    public static byte[] readBytes(ByteBuffer buffer, int length) {
        byte[] ab = new byte[length];
        buffer.get(ab);//from w  w w  . j  a va  2  s .  co m
        return ab;
    }
}

Related

  1. readByteAsInt(ByteBuffer buffer)
  2. readBytes(ByteBuffer bb, int length)
  3. readBytes(ByteBuffer bb, int length)
  4. readBytes(ByteBuffer buf, int length)
  5. readBytes(ByteBuffer buffer)
  6. readBytes(ByteBuffer buffer, int position, int length)
  7. readBytes(final ByteBuffer bb, final int length)
  8. toByteBuffer(byte[] array)
  9. toByteBuffer(byte[] bytes)