docs: private void buildHuffTable(final int tab[], final int L[], final int V[][]) throws IOException {
          int temp = 256;
          int k = 0;
  
          for (int i = 0; i < 8; i++) { // i+1 is Code length
              for (int j = 0; j < L[i]; j++) {
                  for (int n = 0; n < (temp >> (i + 1)); n++) {
                      tab[k] = V[i][j] | ((i + 1) << 8);
                      k++;
                  }
              }
          }
  
          for (int i = 1; k < 256; i++, k++) {
              tab[k] = i | MSB;
          }
  
          int currentTable = 1;
          k = 0;
  
          for (int i = 8; i < 16; i++) { // i+1 is Code length
              for (int j = 0; j < L[i]; j++) {
                  for (int n = 0; n < (temp >> (i - 7)); n++) {
                      tab[(currentTable * 256) + k] = V[i][j] | ((i + 1) << 8);
                      k++;
                  }
                  if (k >= 256) {
                      if (k > 256) {
                          throw new IIOException("JPEG Huffman Table error");
                      }
  
                      k = 0;
                      currentTable++;
                  }
              }
          }
      }