Java Long Number Create fromLong(byte[] buffer, int pos, long l)

Here you can find the source of fromLong(byte[] buffer, int pos, long l)

Description

from Long

License

Apache License

Declaration

public static int fromLong(byte[] buffer, int pos, long l) 

Method Source Code

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

public class Main {
    public static int fromLong(byte[] buffer, int pos, long l) {
        buffer[pos] = (byte) ((l >> 56) & 255);
        buffer[pos + 1] = (byte) ((l >> 48) & 255);
        buffer[pos + 2] = (byte) ((l >> 40) & 255);
        buffer[pos + 3] = (byte) ((l >> 32) & 255);
        buffer[pos + 4] = (byte) ((l >> 24) & 255);
        buffer[pos + 5] = (byte) ((l >> 16) & 255);
        buffer[pos + 6] = (byte) ((l >> 8) & 255);
        buffer[pos + 7] = (byte) (l & 255);
        return pos + 8;
    }/*  w w w  .j a v  a 2s . c  o  m*/
}

Related

  1. convertLongArrayToDoubleArray(long[] values)
  2. convertLongFromBytes(byte[] bytes)
  3. convertLongitudeFromMercator( double mercatorLongitude)
  4. convertLongPriceToString(long price)
  5. convertLongtoMultiByte(long val)
  6. fromLong(long value, byte[] arr, int offset)
  7. fromLongLE(byte src[], int offset, int numBytes)
  8. toLong(boolean b)
  9. toLong(boolean... a)