code: public void write(byte[] b, int off, int len) throws IOException {
          // Sanity checks
          ensureOpen();
          if (b == null) {
              throw new NullPointerException("Null buffer for read");
          } else if (off < 0 || len < 0 || len > b.length - off) {
              throw new IndexOutOfBoundsException();
          } else if (len == 0) {
              return;
          }
  
          // Write uncompressed data to the output stream
          try {
              for (;;) {
                  int n;
  
                  // Fill the decompressor buffer with output data
                  if (inf.needsInput()) {
                      int part;
  
                      if (len < 1) {
                          break;
                      }
  
                      part = (len < 512 ? len : 512);
                      inf.setInput(b, off, part);
                      off += part;
                      len -= part;
                  }
  
                  // Decompress and write blocks of output data
                  do {
                      n = inf.inflate(buf, 0, buf.length);
                      if (n > 0) {
                          out.write(buf, 0, n);
                      }
                  } while (n > 0);
  
                  // Check the decompressor
                  if (inf.finished()) {
                      break;
                  }
                  if (inf.needsDictionary()) {
                      throw new ZipException("ZLIB dictionary missing");
                  }
              }
          } catch (DataFormatException ex) {
              // Improperly formatted compressed (ZIP) data
              String msg = ex.getMessage();
              if (msg == null) {
                  msg = "Invalid ZLIB data format";
              }
              throw new ZipException(msg);
          }
      }
docs: Writes an array of bytes to the uncompressed output stream.
  
  @param b buffer containing compressed data to decompress and write to
  the output stream
  @param off starting offset of the compressed data within {@code b}
  @param len number of bytes to decompress from {@code b}
  @throws IndexOutOfBoundsException if {@code off < 0}, or if
  {@code len < 0}, or if {@code len > b.length - off}
  @throws IOException if an I/O error occurs or this stream is already
  closed
  @throws NullPointerException if {@code b} is null
  @throws ZipException if a compression (ZIP) format error occurs