code: func WriteDeflateLevel(w io.Writer, p []byte, level int) (int, error) {
  	switch w.(type) {
  	case *byteSliceWriter,
  		*bytes.Buffer,
  		*bytebufferpool.ByteBuffer:
  		// These writers don't block, so we can just use stacklessWriteDeflate
  		ctx := &compressCtx{
  			w:     w,
  			p:     p,
  			level: level,
  		}
  		stacklessWriteDeflate(ctx)
  		return len(p), nil
  	default:
  		zw := acquireStacklessDeflateWriter(w, level)
  		n, err := zw.Write(p)
  		releaseStacklessDeflateWriter(zw, level)
  		return n, err
  	}
  }
docs: // WriteDeflateLevel writes deflated p to w using the given compression level
  // and returns the number of compressed bytes written to w.
  //
  // Supported compression levels are:
  //
  //    * CompressNoCompression
  //    * CompressBestSpeed
  //    * CompressBestCompression
  //    * CompressDefaultCompression
  //    * CompressHuffmanOnly