code: public byte[] decode(byte data[], byte uncompData[], int h) {
          
          if(data[0] == (byte)0x00 && data[1] == (byte)0x01) {
              throw new UnsupportedOperationException("TIFF 5.0-style LZW codes are not supported.");
          }
          
          initializeStringTable();
          
          this.data = data;
          this.h = h;
          this.uncompData = uncompData;
          
          // Initialize pointers
          bytePointer = 0;
          bitPointer = 0;
          dstIndex = 0;
          
          
          nextData = 0;
          nextBits = 0;
          
          int code, oldCode = 0;
          byte string[];
          
          while ( ((code = getNextCode()) != 257) &&
          dstIndex < uncompData.length) {
              
              if (code == 256) {
                  
                  initializeStringTable();
                  code = getNextCode();
                  
                  if (code == 257) {
                      break;
                  }
                  
                  writeString(stringTable[code]);
                  oldCode = code;
                  
              } else {
                  
                  if (code < tableIndex) {
                      
                      string = stringTable[code];
                      
                      writeString(string);
                      addStringToTable(stringTable[oldCode], string[0]);
                      oldCode = code;
                      
                  } else {
                      
                      string = stringTable[oldCode];
                      string = composeString(string, string[0]);
                      writeString(string);
                      addStringToTable(string);
                      oldCode = code;
                  }
                  
              }
              
          }
          
          // Horizontal Differencing Predictor
          if (predictor == 2) {
              
              int count;
              for (int j = 0; j < h; j++) {
                  
                  count = samplesPerPixel * (j * w + 1);
                  
                  for (int i = samplesPerPixel; i < w * samplesPerPixel; i++) {
                      
                      uncompData[count] += uncompData[count - samplesPerPixel];
                      count++;
                  }
              }
          }
          
          return uncompData;
      }
docs: Method to decode LZW compressed data.
  
  @param data            The compressed data.
  @param uncompData      Array to return the uncompressed data in.
  @param h               The number of rows the compressed data contains.