Android Int to Byte Array Convert splitInt(int value)

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

Description

split Int

Declaration

public static byte[] splitInt(int value) 

Method Source Code

//package com.java2s;

public class Main {
    public static byte[] splitInt(int value) {
        byte[] bytes = new byte[2];
        bytes[0] = (byte) value;
        bytes[1] = (byte) (value >>> 8);
        return bytes;
    }/*from  ww w.java 2 s  . co m*/
}

Related

  1. toByteArray(int in, int outSize)
  2. getTwoBytes(int i)
  3. getTwoBytes(int i, byte[] target, int pos)
  4. getFourBytes(int i)
  5. getFourBytes(int i, byte[] target, int pos)
  6. int2Byte(int value)
  7. int2ByteArray(int value)
  8. int2ByteArray1(int value)
  9. int2ByteArray11(int value)