Android Int to Byte Array Convert int2ByteArray3(int value)

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

Description

int Byte Array

Declaration

public static byte[] int2ByteArray3(int value) 

Method Source Code

//package com.java2s;

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

Related

  1. splitInt(int value)
  2. int2Byte(int value)
  3. int2ByteArray(int value)
  4. int2ByteArray1(int value)
  5. int2ByteArray11(int value)
  6. int2byte(int input)
  7. int2byteWithInvert(int input)
  8. int2bytesBE(int val, byte[] b, int off)
  9. int2bytesLE(int val, byte[] b, int off)