Java ByteBuffer to Byte Array getByteArrayFromBuffer(ByteBuffer byteBuf)

Here you can find the source of getByteArrayFromBuffer(ByteBuffer byteBuf)

Description

get Byte Array From Buffer

License

Open Source License

Declaration

private static byte[] getByteArrayFromBuffer(ByteBuffer byteBuf) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.nio.ByteBuffer;

public class Main {
    private static byte[] getByteArrayFromBuffer(ByteBuffer byteBuf) {
        byteBuf.flip();//w  w w  .  j a va  2  s  . c om
        byte[] row = new byte[byteBuf.limit()];
        byteBuf.get(row);
        byteBuf.clear();
        return row;
    }
}

Related

  1. deserializeBytes(ByteBuffer buf)
  2. getByteArray(ByteBuffer buff)
  3. getByteArray(ByteBuffer byteBuffer)
  4. getByteArray(ByteBuffer byteBuffer)
  5. getByteArray(final ByteBuffer buff)
  6. getByteArrayFromByteBuffer(ByteBuffer content)
  7. getBytes(ByteBuffer bb)
  8. getBytes(ByteBuffer buf)
  9. getBytes(ByteBuffer buf)