Android Byte Array Encode putLong(byte[] bb, long x, int index)

Here you can find the source of putLong(byte[] bb, long x, int index)

Description

put Long

Declaration

public static void putLong(byte[] bb, long x, int index) 

Method Source Code

//package com.java2s;

public class Main {
    public static void putLong(byte[] bb, long x, int index) {

        bb[index + 0] = (byte) (x >> 56);
        bb[index + 1] = (byte) (x >> 48);
        bb[index + 2] = (byte) (x >> 40);
        bb[index + 3] = (byte) (x >> 32);
        bb[index + 4] = (byte) (x >> 24);
        bb[index + 5] = (byte) (x >> 16);
        bb[index + 6] = (byte) (x >> 8);
        bb[index + 7] = (byte) (x >> 0);
    }//from w  w w .  java  2  s  .c o  m
}

Related

  1. encode3to4(byte[] source, int srcOffset, int numSigBytes, byte[] destination, int destOffset, int options)
  2. putChar(byte[] bb, char ch, int index)
  3. putDouble(byte[] bb, double x, int index)
  4. putInt(int value, int offset, byte[] byteArr)
  5. putInts(int[] fromInts, byte[] toBytes)
  6. putOrCopyString(String fromString, byte[] toBytes)
  7. putReverseBytesInt(byte[] bb, int x, int index)
  8. putReverseBytesLong(byte[] bb, long x, int index)