Here you can find the source of readBER32(ByteBuffer input)
public static int readBER32(ByteBuffer input)
//package com.java2s; //License from project: Open Source License import java.nio.ByteBuffer; public class Main { public static int readBER32(ByteBuffer input) { int size = 0; for (int i = 0; i < 4; i++) { byte b = input.get(); size = (size << 7) | (b & 0x7f); if (((b & 0xff) >> 7) == 0) break; }//from w w w . j a v a 2 s . c o m return size; } }