Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
/*
 *  Copyright (C) 2014 Ingenic Semiconductor
 *
 *  ZhangYanMing <yanming.zhang@ingenic.com, jamincheung@126.com>
 *
 *  Elf/IDWS Project
 *
 *  This program is free software; you can redistribute it and/or modify it
 *  under the terms of the GNU General Public License as published by the
 *  Free Software Foundation; either version 2 of the License, or (at your
 *  option) any later version.
 *
 *  You should have received a copy of the GNU General Public License along
 *  with this program; if not, write to the Free Software Foundation, Inc.,
 *  675 Mass Ave, Cambridge, MA 02139, USA.
 *
 */

public class Main {
    private static double readDouble(byte[] bytes) {
        long bits = 0;
        bits = (long) ((((long) bytes[0] << 56) & 0xff00000000000000L)
                | (((long) bytes[1] << 48) & 0x00ff000000000000L) | (((long) bytes[2] << 40) & 0x0000ff0000000000L)
                | (((long) bytes[3] << 32) & 0x000000ff00000000L) | (((long) bytes[4] << 24) & 0x00000000ff000000L)
                | (((long) bytes[5] << 16) & 0x0000000000ff0000L) | (((long) bytes[6] << 8) & 0x000000000000ff00L)
                | (((long) bytes[7] << 0) & 0x00000000000000ffL));
        return Double.longBitsToDouble(bits);
    }
}