Here you can find the source of long2minLeb(final long x)
public static byte[] long2minLeb(final long x) throws IllegalArgumentException
//package com.java2s; //License from project: Apache License public class Main { public static byte[] long2minLeb(final long x) throws IllegalArgumentException { if (x <= 0xFFFFFFFFFFFFFFL) { if (x <= 0xFFFFFFFFFFFFL) { if (x <= 0xFFFFFFFFFFL) { if (x <= 0xFFFFFFFFL) { if (x <= 0xFFFFFFL) { if (x <= 0xFFFFL) { if (x <= 0xFFL) { if (x < 0) throw new IllegalArgumentException(); return new byte[] { (byte) x }; }/*from w w w . j a v a 2 s . co m*/ return new byte[] { (byte) x, (byte) (x >> 8) }; } return new byte[] { (byte) x, (byte) (x >> 8), (byte) (x >> 16) }; } return new byte[] { (byte) x, (byte) (x >> 8), (byte) (x >> 16), (byte) (x >> 24) }; } return new byte[] { (byte) x, (byte) (x >> 8), (byte) (x >> 16), (byte) (x >> 24), (byte) (x >> 32) }; } return new byte[] { (byte) x, (byte) (x >> 8), (byte) (x >> 16), (byte) (x >> 24), (byte) (x >> 32), (byte) (x >> 40) }; } return new byte[] { (byte) x, (byte) (x >> 8), (byte) (x >> 16), (byte) (x >> 24), (byte) (x >> 32), (byte) (x >> 40), (byte) (x >> 48) }; } return new byte[] { (byte) x, (byte) (x >> 8), (byte) (x >> 16), (byte) (x >> 24), (byte) (x >> 32), (byte) (x >> 40), (byte) (x >> 48), (byte) (x >> 56) }; } }