Java ByteBuffer to Byte Array asByteArray(ByteBuffer buf)

Here you can find the source of asByteArray(ByteBuffer buf)

Description

as Byte Array

License

Open Source License

Declaration

public static byte[] asByteArray(ByteBuffer buf) 

Method Source Code


//package com.java2s;
import java.nio.ByteBuffer;

public class Main {
    public static byte[] asByteArray(ByteBuffer buf) {
        byte[] bytes = new byte[buf.remaining()];
        buf.get(bytes);/*from   w  w w  .ja va2s .  co  m*/
        return bytes;
    }
}

Related

  1. asByteArray(ByteBuffer buf)
  2. byteBufferToByteArray(ByteBuffer buf)
  3. ByteBufferToByteArray(ByteBuffer byteBuffer)
  4. byteBufferToByteArray(ByteBuffer byteBuffer)
  5. byteBufferToByteArray(List byteBufferList)