Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import java.io.ByteArrayInputStream;

import java.io.DataInputStream;

import java.io.IOException;

public class Main {
    public static long byteArrayToLong(byte[] input) {
        try {
            ByteArrayInputStream bis = new ByteArrayInputStream(input);
            DataInputStream dis = new DataInputStream(bis);
            long numb = dis.readLong();
            dis.close();
            return numb;
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }
}