Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

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

import java.nio.ByteBuffer;

public class Main {
    public static long bytearray2long(byte[] b) {
        //TODO optimize with creating a new ByteBuffer object

        ByteBuffer buf = ByteBuffer.wrap(b, 0, 8);
        return buf.getLong();
    }
}