Java Convert via ByteBuffer IntToBArray(int src)

Here you can find the source of IntToBArray(int src)

Description

Int To B Array

License

Open Source License

Declaration

static public byte[] IntToBArray(int src) 

Method Source Code


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

import java.nio.ByteBuffer;

public class Main {
    static public byte[] IntToBArray(int src) {

        return ByteBuffer.allocate(4).putInt(src).array();

    }/*  www  .  ja  va 2 s  . c  om*/
}

Related

  1. intArrayFromBytes(byte[] bytes)
  2. intArrayToByteArray(int[] intArray)
  3. intArrayToBytes(Collection values)
  4. intArrayToIntBuffer(int[] data)
  5. intsToBytes(int[] n)
  6. intToByte(int[] intArray)
  7. intToByteArray(int integer)
  8. intToByteArray(int l)
  9. intToByteArray(int number)