Java ByteBuffer to Byte Array toArray(ByteBuffer buffer)

Here you can find the source of toArray(ByteBuffer buffer)

Description

to Array

License

Apache License

Declaration

public static byte[] toArray(ByteBuffer buffer) 

Method Source Code


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

import java.nio.ByteBuffer;

public class Main {
    public static byte[] toArray(ByteBuffer buffer) {
        byte[] arr = new byte[buffer.limit()];
        buffer.get(arr);// w  ww. j  a  v a  2s . co m
        return arr;
    }
}

Related

  1. toArray(ByteBuffer buffer)
  2. toArray(ByteBuffer buffer)
  3. toArray(ByteBuffer buffer)
  4. toArray(ByteBuffer buffer)
  5. toArray(ByteBuffer buffer)
  6. toArray(ByteBuffer buffer)
  7. toArray(ByteBuffer bytebuffer)
  8. toArray(final ByteBuffer b)
  9. toArray(final ByteBuffer buffer)