Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
import java.nio.ByteBuffer;

public class Main {
    public static long bytesToLong(byte[] bytes) {
        long l = 0;
        try {
            ByteBuffer buffer = ByteBuffer.allocate(8);
            buffer.put(bytes, 0, bytes.length);
            buffer.flip();//need flip
            l = buffer.getLong();
        } catch (Exception e) {

        }
        return l;
    }
}