Java Integer to Byte Array intToBytes(int val, byte[] bytes, int start)

Here you can find the source of intToBytes(int val, byte[] bytes, int start)

Description

int To Bytes

License

LGPL

Declaration

public static void intToBytes(int val, byte[] bytes, int start) 

Method Source Code

//package com.java2s;
//License from project: LGPL 

public class Main {
    public static void intToBytes(int val, byte[] bytes, int start) {
        bytes[start + 0] = (byte) val;
        bytes[start + 1] = (byte) (0xff & (val >> 8));
        bytes[start + 2] = (byte) (0xff & (val >> 16));
        bytes[start + 3] = (byte) (0xff & (val >> 24));
    }//from w  w  w.  jav a  2s .  co  m
}

Related

  1. intToBytes(int v)
  2. intToBytes(int v)
  3. intToBytes(int v, byte[] bytes)
  4. intToBytes(int v, final byte[] arr)
  5. intToBytes(int val)
  6. intToBytes(int val, int byteCount)
  7. intToBytes(int value)
  8. intToBytes(int value)
  9. intToBytes(int value)