Android Byte Array to Int Convert intToOctet(byte[] buf, int i)

Here you can find the source of intToOctet(byte[] buf, int i)

Description

int To Octet

License

Open Source License

Declaration

private static void intToOctet(byte[] buf, int i) 

Method Source Code

//package com.java2s;
//License from project: GNU General Public License 

public class Main {
    private static void intToOctet(byte[] buf, int i) {
        buf[0] = (byte) (i >>> 24);
        buf[1] = (byte) (i >>> 16);
        buf[2] = (byte) (i >>> 8);
        buf[3] = (byte) i;
    }/*w  w  w  . j a v  a  2 s .  c o  m*/
}

Related

  1. toInteger(byte[] input, int offset)
  2. readInt(byte[] buff, int pos)
  3. getShort(byte[] data)
  4. getUnsignedSafe(byte[] buffer, int pos)
  5. toUInt16(byte[] bytes, int start)
  6. readInt(byte[] byteArray, int offset)
  7. writeInt(byte[] byteArray, int offset, int i)