Android Int to Byte Array Convert putInt(byte[] bb, int x, int index)

Here you can find the source of putInt(byte[] bb, int x, int index)

Description

put Int

Declaration

public static void putInt(byte[] bb, int x, int index) 

Method Source Code

//package com.java2s;

public class Main {

    public static void putInt(byte[] bb, int x, int index) {
        bb[index + 0] = (byte) (x >> 24);
        bb[index + 1] = (byte) (x >> 16);
        bb[index + 2] = (byte) (x >> 8);
        bb[index + 3] = (byte) (x >> 0);
    }//from   w ww. j a  v  a2 s.  c  o m
}

Related

  1. intToBytes(int number)
  2. intToBytes(int x)
  3. toBytes(int value)
  4. toBytes(int value, byte[] dest, int destPos)
  5. getBytes(int data)
  6. putInt(byte[] bb, int x, int index)
  7. int2bytes(int val)
  8. IntToByte(int i)
  9. uInt16ToBytesBI(int value)