Here you can find the source of putDouble(byte[] b, double val)
static void putDouble(byte[] b, double val)
//package com.java2s; /*//from w w w . ja v a 2 s .c o m * Copyright (C) 2013, Peter Decsi. * * This library is free software: you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation, either * version 3 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this library. If not, see <http://www.gnu.org/licenses/>. */ public class Main { static void putDouble(byte[] b, double val) { long j = Double.doubleToLongBits(val); b[7] = (byte) (j >>> 0); b[6] = (byte) (j >>> 8); b[5] = (byte) (j >>> 16); b[4] = (byte) (j >>> 24); b[3] = (byte) (j >>> 32); b[2] = (byte) (j >>> 40); b[1] = (byte) (j >>> 48); b[0] = (byte) (j >>> 56); } }