Java Convert via ByteBuffer toByteArray(double value)

Here you can find the source of toByteArray(double value)

Description

to Byte Array

License

Open Source License

Declaration

public static byte[] toByteArray(double value) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.nio.ByteBuffer;

public class Main {
    public static byte[] toByteArray(double value) {
        byte[] bytes = new byte[8];
        ByteBuffer.wrap(bytes).putDouble(value);
        return bytes;
    }/*from  w w  w. j  a v a 2  s. co m*/
}

Related

  1. toByte(char data)
  2. toByte(final char[] charArray)
  3. toByte(int input, int count)
  4. toByteArray(BitSet bits)
  5. toByteArray(char[] chars)
  6. toByteArray(double[] doubleArray)
  7. toByteArray(float[] floatArray)
  8. toByteArray(InputStream input, boolean nioCopy)
  9. toByteArray(int i)