Java ByteBuffer to Byte Array toByteArray(ByteBuffer buffer)

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

Description

to Byte Array

License

Apache License

Declaration

public static byte[] toByteArray(ByteBuffer buffer) 

Method Source Code


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

import java.nio.ByteBuffer;

public class Main {
    public static byte[] toByteArray(ByteBuffer buffer) {
        return buffer != null && buffer.hasArray() ? buffer.array() : null;
    }//from www .j a  v a2 s .c  om
}

Related

  1. toByteArray(ByteBuffer bb)
  2. toByteArray(ByteBuffer buf)
  3. toByteArray(ByteBuffer buffer)
  4. toByteArray(ByteBuffer buffer)
  5. toByteArray(ByteBuffer buffer)
  6. toByteArray(ByteBuffer buffer, int length)
  7. toByteArray(ByteBuffer buffer, int length)
  8. toByteArray(ByteBuffer bytes)
  9. toByteArrayByByteBuffer(int value)