Here you can find the source of longToHeight(long x)
public static int longToHeight(long x)
//package com.java2s; /*//from w w w .j a v a 2 s. c o m * Copyright (c) 2014 CIYAM Developers Distributed under the MIT/X11 software license, please refer to the file license.txt in the root project directory or http://www.opensource.org/licenses/mit-license.php. */ import java.nio.ByteBuffer; import java.nio.ByteOrder; public class Main { public static int longToHeight(long x) { ByteBuffer buffer = ByteBuffer.allocate(8); buffer.order(ByteOrder.LITTLE_ENDIAN); buffer.putLong(0, x); return buffer.getInt(4); } }