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 + 3] = (byte) (x >> 24);
        bb[index + 2] = (byte) (x >> 16);
        bb[index + 1] = (byte) (x >> 8);
        bb[index + 0] = (byte) (x >> 0);
    }// w  w w  .java2s.  co m
}

Related

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