#vulnerable code 
                              @Override
  public int decompress(byte[] src, int srcOffset, int srcLength, byte[] dst, int dstOff) {
    if (srcLength - srcOffset == 0) {
      return 0;
    }
    try {
      ByteArrayInputStream bytesIn = new ByteArrayInputStream(src, srcOffset, srcLength);
      GZIPInputStream gzip = new GZIPInputStream(bytesIn);
      int curOff = dstOff;
      while (true) {
        int amtRead = gzip.read(dst, curOff, dst.length - curOff);
        if (amtRead == -1) {
          break;
        }
        curOff += amtRead;
      }
      return curOff;
    } catch (IOException e) {
      throw new RuntimeException("Unexpected IOException while decompressing!", e);
    }
  } 
                            #location 17 
                            #vulnerability type RESOURCE_LEAK
#fixed code
                              @Override
  public int decompress(byte[] src, int srcOffset, int srcLength, byte[] dst, int dstOff) {
    if (srcLength - srcOffset == 0) {
      return 0;
    }
    try {
      ByteArrayInputStream bytesIn = new ByteArrayInputStream(src, srcOffset, srcLength);
      GZIPInputStream gzip = new GZIPInputStream(bytesIn);
      int curOff = dstOff;
      while (curOff < dst.length - dstOff) {
        int amtRead = gzip.read(dst, curOff, dst.length - curOff);
        if (amtRead == -1) {
          break;
        }
        curOff += amtRead;
      }
      return curOff;
    } catch (IOException e) {
      throw new RuntimeException("Unexpected IOException while decompressing!", e);
    }
  }