Java Long to Byte Array longToByteArray(long pSrc, byte[] pDst, int pOffset)

Here you can find the source of longToByteArray(long pSrc, byte[] pDst, int pOffset)

Description

long To Byte Array

License

Open Source License

Declaration

public static void longToByteArray(long pSrc, byte[] pDst, int pOffset) 

Method Source Code

//package com.java2s;

public class Main {
    public static void longToByteArray(long pSrc, byte[] pDst, int pOffset) {
        pDst[pOffset] = (byte) (pSrc >>> 56);
        pDst[pOffset + 1] = (byte) (pSrc >>> 48);
        pDst[pOffset + 2] = (byte) (pSrc >>> 40);
        pDst[pOffset + 3] = (byte) (pSrc >>> 32);
        pDst[pOffset + 4] = (byte) (pSrc >>> 24);
        pDst[pOffset + 5] = (byte) (pSrc >>> 16);
        pDst[pOffset + 6] = (byte) (pSrc >>> 8);
        pDst[pOffset + 7] = (byte) pSrc;
    }/*from   w ww .  j  a va 2  s .  c o  m*/
}

Related

  1. longToByteArray(long l)
  2. longToByteArray(long l)
  3. longToByteArray(long l)
  4. longToByteArray(long longHi, long longLo, byte[] array, int offset)
  5. longToByteArray(long number)
  6. longToByteArray(long source)
  7. longToByteArray(long v)
  8. longToByteArray(long value)
  9. longToByteArray(long value)