Android examples for File Input Output:Byte Array Convert
Convert int To Byte array by shifting right
//package com.java2s; public class Main { public static byte[] intToBytes(int l) { byte[] result = new byte[4]; for (int i = 3; i >= 0; i--) { result[i] = (byte) (l & 0xFF); l >>= 8;/* w ww .ja v a 2s . c o m*/ } return result; } }