Java Byte Array Value Set setBytesFromInt(byte[] ret, int value, int offs)

Here you can find the source of setBytesFromInt(byte[] ret, int value, int offs)

Description

set Bytes From Int

License

Open Source License

Declaration

final static void setBytesFromInt(byte[] ret, int value, int offs) 

Method Source Code

//package com.java2s;

public class Main {
    final static void setBytesFromInt(byte[] ret, int value, int offs) {
        int v = value;
        int j = offs;
        ret[j++] = (byte) ((v >>> 24) & 0xFF);
        ret[j++] = (byte) ((v >>> 16) & 0xFF);
        ret[j++] = (byte) ((v >>> 8) & 0xFF);
        ret[j++] = (byte) ((v >>> 0) & 0xFF);
    }/*from w ww  .  jav a  2s  . c o m*/
}

Related

  1. setBytes(byte[] setTo, int startTo, byte[] setFrom, int startFrom, int len)
  2. setBytes(final byte[] dest, final byte[] data, final int offset, int length)
  3. setBytes(int value, int offset, byte[] bytes)
  4. setBytes(long value, int offset, byte[] bytes)
  5. setBytes(short value, int offset, byte[] bytes)
  6. setBytesFromLong(byte[] ret, long value, int offs)