Java Integer Convert To integerToByte(int i)

Here you can find the source of integerToByte(int i)

Description

integer To Byte

License

Open Source License

Declaration

public static byte[] integerToByte(int i) 

Method Source Code

//package com.java2s;

public class Main {
    public static byte[] integerToByte(int i) {
        byte[] buffer = new byte[4];
        buffer[0] = (byte) (i);
        buffer[1] = (byte) (i >> 8);
        buffer[2] = (byte) (i >> 16);
        buffer[3] = (byte) (i >> 24);

        return buffer;
    }//from  www.  ja v  a2 s  .co m
}

Related

  1. fromInts(int[] values)
  2. fromIntString(Object obj)
  3. fromIntWithPrefix(byte prefix, int v)
  4. IntegerTo(Integer i)
  5. integerToASCII(int number)
  6. IntegerTochar(final Integer value)
  7. integerToFloat(float f, int i, float offset, boolean rotate)
  8. IntegerToInt(Integer[] in)
  9. integerToLittleEndian(byte[] buf, int offset, long value, int numBytes)