Here you can find the source of distExtraBits(int dist)
private static int distExtraBits(int dist)
//package com.java2s; //License from project: Open Source License public class Main { private static int distExtraBits(int dist) { if (dist < 5) { return 0; } else if (dist < 9) { return 1; } else if (dist < 17) { return 2; } else if (dist < 33) { return 3; } else if (dist < 65) { return 4; } else if (dist < 129) { return 5; } else if (dist < 257) { return 6; } else if (dist < 513) { return 7; } else if (dist < 1025) { return 8; } else if (dist < 2049) { return 9; } else if (dist < 4097) { return 10; } else if (dist < 8193) { return 11; } else if (dist < 16385) { return 12; }//ww w . ja v a2s. c o m return 13; } }