Android Int to Byte Array Convert int2ByteArray1(int value)

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

Description

int Byte Array

Declaration

public static byte[] int2ByteArray1(int value) 

Method Source Code

//package com.java2s;

public class Main {
    public static byte[] int2ByteArray1(int value) {
        byte[] b = new byte[1];
        for (int i = 0; i < 1; i++) {
            int offset = (b.length - 1 - i) * 8;
            b[i] = (byte) ((value >>> offset) & 0xFF);
        }/* w ww  . j  a  va2  s .  co m*/
        return b;
    }
}

Related

  1. getFourBytes(int i)
  2. getFourBytes(int i, byte[] target, int pos)
  3. splitInt(int value)
  4. int2Byte(int value)
  5. int2ByteArray(int value)
  6. int2ByteArray11(int value)
  7. int2ByteArray3(int value)
  8. int2byte(int input)
  9. int2byteWithInvert(int input)