code: @Nonnull
    @ReturnsMutableCopy
    public static byte [] decode (@Nonnull final String s, final int options) throws IOException
    {
      ValueEnforcer.notNull (s, "InputString");
  
      byte [] bytes = s.getBytes (PREFERRED_ENCODING);
  
      // Decode
      bytes = decode (bytes, 0, bytes.length, options);
  
      // Check to see if it's gzip-compressed
      // GZIP Magic Two-Byte Number: 0x8b1f (35615)
      final boolean dontGunzip = (options & DONT_GUNZIP) != 0;
      if (bytes.length >= 4 && !dontGunzip)
      {
        final int head = (bytes[0] & 0xff) | ((bytes[1] << 8) & 0xff00);
        if (GZIPInputStream.GZIP_MAGIC == head)
        {
          try (final NonBlockingByteArrayOutputStream baos = new NonBlockingByteArrayOutputStream ();
              final NonBlockingByteArrayInputStream bais = new NonBlockingByteArrayInputStream (bytes);
              final GZIPInputStream gzis = new GZIPInputStream (bais))
          {
            final byte [] buffer = new byte [2048];
            int length;
            while ((length = gzis.read (buffer)) >= 0)
            {
              baos.write (buffer, 0, length);
            }
  
            // No error? Get new bytes.
            bytes = baos.toByteArray ();
          }
          catch (final IOException e)
          {
            // Just return originally-decoded bytes
          }
        }
      }
  
      return bytes;
    }
docs: Decodes data from Base64 notation, automatically detecting gzip-compressed
  data and decompressing it.
  
  @param s
  the string to decode
  @param options
  encode options such as URL_SAFE
  @return the decoded data
  @throws IOException
  if there is an error
  @throws NullPointerException
  if <code>s</code> is null
  @since 1.4