Java Integer to Byte Array fromIntToByte(int integer)

Here you can find the source of fromIntToByte(int integer)

Description

from Int To Byte

License

Apache License

Declaration

public static byte[] fromIntToByte(int integer) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

public class Main {
    public static byte[] fromIntToByte(int integer) {
        String s = String.valueOf(integer);
        byte[] b = new byte[s.length()];
        for (int i = 0; i < s.length(); i++) {
            b[i] = (byte) s.charAt(i);
        }/*from   w w w  . ja v a2 s .c  o m*/
        return b;
    }
}

Related

  1. convertIntegerToByteArray(int value, int bytes, boolean revers)
  2. convertIntToByteArray(int value)
  3. convertIntToByteArray(int value, int numberOfBytes)
  4. convertIntToByteArray(int[] rgb)
  5. convertIntToBytes(int i)
  6. fromIntToByteArray(int value)
  7. int2Arr(int var, byte[] arrayBytes, int startIndex)
  8. int2ByteLE(byte[] bytes, int value, int offset)
  9. int2bytes(int i)