private static void generateClass(FileWriter fw, int bitWidth, boolean isLong, boolean msbFirst) throws IOException {
        String namePrefix = isLong ? "Long" : "Int";
        fw.append("  private static final class Packer" + bitWidth + " extends " + namePrefix + "Packer {\n");
        fw.append("\n");
        fw.append("    private Packer" + bitWidth + "() {\n");
        fw.append("      super("+bitWidth+");\n");
        fw.append("    }\n");
        //fw.append("    public int bitWidth(){return " + bitWidth + ";}\n");
        fw.append("\n");
        // Packing
        generatePack(fw, bitWidth, isLong);
        generatePack(fw, bitWidth, 1, isLong, msbFirst);

        // Unpacking
        generateUnpack(fw, bitWidth, isLong);
        generateUnpack(fw, bitWidth, 1, isLong, msbFirst, true);
        //generateUnpack(fw, bitWidth, 1, isLong, msbFirst, false);
        //generateUnpack(fw, bitWidth, 4, isLong, msbFirst, true);
        //generateUnpack(fw, bitWidth, 4, isLong, msbFirst, false);

        fw.append("  }\n");
    }
\n");
        if (msbFirst) {
            fw.append(" * Packs from the Most Significant Bit first\n");
        } else {
            fw.append(" * Packs from the Least Significant Bit first\n");
        }
        fw.append(" * \n");
        fw.append(" * @author automatically generated\n");
        fw.append(" * @see ByteBasedBitPackingGenerator\n");
        fw.append(" *\n");
        fw.append("
indexr-codegen/src/main/java/io/indexr/vlt/codec/pack/PackingClassGen.java