Java Long Number Create convertLongAddressToBuf(long ipAddress)

Here you can find the source of convertLongAddressToBuf(long ipAddress)

Description

convert Long Address To Buf

License

Apache License

Declaration

private static byte[] convertLongAddressToBuf(long ipAddress) 

Method Source Code

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

public class Main {
    private static byte[] convertLongAddressToBuf(long ipAddress) {
        byte[] result = new byte[4];
        result[0] = (byte) ((ipAddress >> 24) & 0xFF);
        result[1] = (byte) ((ipAddress >> 16) & 0xFF);
        result[2] = (byte) ((ipAddress >> 8) & 0xFF);
        result[3] = (byte) ((ipAddress >> 0) & 0xFF);
        return result;
    }/*  w w w .  j a v  a 2  s.  c om*/
}

Related

  1. convertLong(byte[] data, int offset)
  2. convertLong(long v, boolean isLE)
  3. convertLong2FourBytes(long data)
  4. convertLongArray(long[] arr)
  5. convertLongArrayFromHex(char[] hex)
  6. convertLongArrayToDoubleArray(long[] values)
  7. convertLongFromBytes(byte[] bytes)