Java Long to String long2Word(long val)

Here you can find the source of long2Word(long val)

Description

long Word

License

Open Source License

Declaration

public static byte[] long2Word(long val) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    public static byte[] long2Word(long val) {
        byte[] ret = new byte[4];
        int firstByte = (int) (val & 0xFF000000L) >> 24;
        int secondByte = (int) (val & 0x00FF0000L) >> 16;
        int thirdByte = (int) (val & 0x0000FF00L) >> 8;
        int fourthByte = (int) (val & 0x000000FFL);

        ret[0] = (byte) firstByte;
        ret[1] = (byte) secondByte;
        ret[2] = (byte) thirdByte;
        ret[3] = (byte) fourthByte;

        return (ret);
    }//  www  .  jav a 2  s.  c om
}

Related

  1. Long2String(final long value)
  2. long2string(long lng, StringBuilder buff)
  3. long2string(long longdata)
  4. long2String(long x)
  5. long2StringForLen(long num, String str)
  6. LongToStr(long nValue)
  7. longToString(final long value)
  8. longToString(long l)
  9. longToString(long l)