docs: private int getHuffmanValue(final int table[], final int temp[], final int index[]) throws IOException {
          int code, input;
          final int mask = 0xFFFF;
  
          if (index[0] < 8) {
              temp[0] <<= 8;
              input = this.input.readUnsignedByte();
              if (input == 0xFF) {
                  marker = this.input.readUnsignedByte();
                  if (marker != 0) {
                      markerIndex = 9;
                  }
              }
              temp[0] |= input;
          }
          else {
              index[0] -= 8;
          }
  
          code = table[temp[0] >> index[0]];
  
          if ((code & MSB) != 0) {
              if (markerIndex != 0) {
                  markerIndex = 0;
                  return 0xFF00 | marker;
              }
  
              temp[0] &= (mask >> (16 - index[0]));
              temp[0] <<= 8;
              input = this.input.readUnsignedByte();
  
              if (input == 0xFF) {
                  marker = this.input.readUnsignedByte();
                  if (marker != 0) {
                      markerIndex = 9;
                  }
              }
  
              temp[0] |= input;
              code = table[((code & 0xFF) * 256) + (temp[0] >> index[0])];
              index[0] += 8;
          }
  
          index[0] += 8 - (code >> 8);
  
          if (index[0] < 0) {
              throw new IIOException("index=" + index[0] + " temp=" + temp[0] + " code=" + code + " in HuffmanValue()");
          }
  
          if (index[0] < markerIndex) {
              markerIndex = 0;
              return 0xFF00 | marker;
          }
  
          temp[0] &= (mask >> (16 - index[0]));
          return code & 0xFF;
      }