Java Byte Array Create toByteArray(int value)

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

Description

to Byte Array

License

Open Source License

Declaration

public static byte[] toByteArray(int value) 

Method Source Code

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

public class Main {
    public static byte[] toByteArray(int value) {
        return new byte[] { (byte) (value >> 24), (byte) (value >> 16), (byte) (value >> 8), (byte) value };
    }//  www  .  j a  v a 2  s .  c  o  m
}

Related

  1. toByteArray(int num)
  2. toByteArray(int value)
  3. toByteArray(int value)
  4. toByteArray(int value)
  5. toByteArray(int value)
  6. toByteArray(int value, int numBytes, byte[] dest, int off)
  7. toByteArray(int[] array)
  8. toByteArray(int[] data)
  9. toByteArray(int[] data, boolean includeLength)