Here you can find the source of getAs_uint32_NetOrder(int theNumber)
Parameter | Description |
---|---|
theNumber | a parameter |
public static byte[] getAs_uint32_NetOrder(int theNumber)
//package com.java2s; public class Main { /**//from w w w . ja va 2 s. c o m * turn 32 bits unsigned integer number to byte array representing the number * in network order. * @param theNumber * @return byte array */ public static byte[] getAs_uint32_NetOrder(int theNumber) { byte[] toReturn = new byte[4]; toReturn[0] = (byte) ((theNumber >> 24) & 0xff0); toReturn[1] = (byte) ((theNumber >> 16) & 0xff); toReturn[2] = (byte) ((theNumber >> 8) & 0xff); toReturn[3] = (byte) (theNumber & 0xff); return toReturn; } }