Android Byte Array Encode putDouble(byte[] bb, double x, int index)

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

Description

put Double

Declaration

public static void putDouble(byte[] bb, double x, int index) 

Method Source Code

//package com.java2s;

public class Main {

    public static void putDouble(byte[] bb, double x, int index) {
        // byte[] b = new byte[8];
        long l = Double.doubleToLongBits(x);
        for (int i = 0; i < 8; i++) {
            bb[index + i] = new Long(l).byteValue();
            l = l >> 8;//from   ww w. ja va2 s. c  o  m
        }
    }
}

Related

  1. encodeWebSafe(byte[] source, boolean doPadding)
  2. encodeWebSafe(byte[] source, boolean doPadding)
  3. encode3to4(byte[] b4, byte[] threeBytes, int numSigBytes, int options)
  4. encode3to4(byte[] source, int srcOffset, int numSigBytes, byte[] destination, int destOffset, int options)
  5. putChar(byte[] bb, char ch, int index)
  6. putInt(int value, int offset, byte[] byteArr)
  7. putInts(int[] fromInts, byte[] toBytes)
  8. putLong(byte[] bb, long x, int index)
  9. putOrCopyString(String fromString, byte[] toBytes)