Java ByteBuffer to Byte Array toByteArrayByByteBuffer(int value)

Here you can find the source of toByteArrayByByteBuffer(int value)

Description

to Byte Array By Byte Buffer

License

Open Source License

Declaration

public static byte[] toByteArrayByByteBuffer(int value) 

Method Source Code


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

import java.nio.ByteBuffer;

public class Main {
    public static byte[] toByteArrayByByteBuffer(int value) {
        return ByteBuffer.allocate(4).putInt(value).array();
    }/*  ww w. j a v  a2  s.c om*/
}

Related

  1. toByteArray(ByteBuffer buffer)
  2. toByteArray(ByteBuffer buffer)
  3. toByteArray(ByteBuffer buffer, int length)
  4. toByteArray(ByteBuffer buffer, int length)
  5. toByteArray(ByteBuffer bytes)
  6. toBytes(ByteBuffer buff)
  7. toBytes(ByteBuffer buffer)
  8. toBytes(ByteBuffer buffer)
  9. toBytes(ByteBuffer buffer, int offset, int length)