Java Long Number Convert To fromLong(long v, int offset, byte[] dest)

Here you can find the source of fromLong(long v, int offset, byte[] dest)

Description

from Long

License

Open Source License

Declaration

public static void fromLong(long v, int offset, byte[] dest) 

Method Source Code

//package com.java2s;
/**//from  ww  w.  j  av a 2 s. c  o m
 * Copyright 2012-2013 Johns Hopkins University HLTCOE. All rights reserved.
 * This software is released under the 2-clause BSD license.
 * See LICENSE in the project root directory.
 */

public class Main {
    public static void fromLong(long v, int offset, byte[] dest) {
        assert (dest.length >= (8 + offset));
        dest[0 + offset] = (byte) ((v >> 56) & 0xff);
        dest[1 + offset] = (byte) ((v >> 48) & 0xff);
        dest[2 + offset] = (byte) ((v >> 40) & 0xff);
        dest[3 + offset] = (byte) ((v >> 32) & 0xff);
        dest[4 + offset] = (byte) ((v >> 24) & 0xff);
        dest[5 + offset] = (byte) ((v >> 16) & 0xff);
        dest[6 + offset] = (byte) ((v >> 8) & 0xff);
        dest[7 + offset] = (byte) ((v >> 0) & 0xff);
    }
}

Related

  1. convertLongToString(long value)
  2. fromLong(long d)
  3. fromLong(long input)
  4. fromLong(long key)
  5. fromLong(long longValue)
  6. fromLong(Long value)
  7. fromLong(long value)
  8. fromLong(long value, int numBytes)
  9. fromLong(long x)