Encode method calls.

@param Definition       $definition The current definition.
@param Encoder          $encoder    The encoder.
@param EncodeValueEvent $event      The event.

@return void
9066
private function handleMethodCalls(Definition $definition, Encoder $encoder, EncodeValueEvent $event)
    {
        $hash = spl_object_hash($definition);

        if (!isset(static::$encodedMethods[$hash])) {
            static::$encodedMethods[$hash] = true;

            foreach ($definition->getMethodCalls() as $method) {
                $event->addLine($method->encode($encoder, Flags::CLOSE_STATEMENT));
            }
        }
    }
661832
private void encodeThis() throws IOException {
        if (notBefore == null && notAfter == null) {
            this.extensionValue = null;
            return;
        }
        DerOutputStream seq = new DerOutputStream();

        DerOutputStream tagged = new DerOutputStream();
        if (notBefore != null) {
            DerOutputStream tmp = new DerOutputStream();
            tmp.putGeneralizedTime(notBefore);
            tagged.writeImplicit(DerValue.createTag(DerValue.TAG_CONTEXT,
                                 false, TAG_BEFORE), tmp);
        }
        if (notAfter != null) {
            DerOutputStream tmp = new DerOutputStream();
            tmp.putGeneralizedTime(notAfter);
            tagged.writeImplicit(DerValue.createTag(DerValue.TAG_CONTEXT,
                                 false, TAG_AFTER), tmp);
        }
        seq.write(DerValue.tag_Sequence, tagged);
        this.extensionValue = seq.toByteArray();
    }
1113857
public void writeEncodeFor(String value, String encodeType) throws IOException, PageException { // FUTURE keyword:encodefore add to interface
	write(ESAPIUtil.esapiEncode(this, encodeType, value));
    }
290088
@Override
	public void encodeEnd(FacesContext context, UIComponent component) throws IOException {
        if (!component.isRendered()) {
            return;
        }
        PanelGrid panelGrid = (PanelGrid) component;
		ResponseWriter writer = context.getResponseWriter();

		boolean idHasBeenRendered=false;
		String responsiveStyle= Responsive.getResponsiveStyleClass(panelGrid, false);
		if (null != responsiveStyle) {
			writer.startElement("div", panelGrid);
			writer.writeAttribute("class", responsiveStyle.trim(), null);
			String clientId = panelGrid.getClientId();
			writer.writeAttribute("id", clientId, "id");
			idHasBeenRendered=true;
		}
		generateContainerStart(writer, panelGrid, idHasBeenRendered);
		beginDisabledFieldset(panelGrid, writer);

		int[] columns = getColSpanArray(panelGrid);
		String[] columnClasses = getColumnClasses(panelGrid, columns);
		String[] rowClasses = getRowClasses(panelGrid);

		int row = 0;
		int column = 0;
		List<UIComponent> children = panelGrid.getChildren();
		for (UIComponent child : children) {
			if (0 == column) {
				generateRowStart(writer, row, rowClasses, panelGrid);
			}
			generateColumnStart(child, columnClasses[column], writer);
			child.encodeAll(context);
			generateColumnEnd(writer, columns[column]);
			column++;
			if (column >= columns.length) {
				generateRowEnd(writer, row, rowClasses);
				column = 0;
				row++;
			}
		}
		if (column != 0) {
			generateRowEnd(writer, row, rowClasses);
			column = 0;
			row++;
		}


		endDisabledFieldset(panelGrid, writer);
		generateContainerEnd(writer);
		if (null != responsiveStyle) {
			writer.endElement("div");
		}
        Tooltip.activateTooltips(context, panelGrid);
	}
253806
public function encode($toEncodingFormat = null, $fromEncodingFormat = null)
    {
        return $this->addRule(new FilterRule\Encode($toEncodingFormat, $fromEncodingFormat));
    }
258432
public function registerEncoder(string $type, IEncoder $encoder): void
    {
        $normalizedType = self::normalizeType($type);
        $this->encodersByType[$normalizedType] = $encoder;
    }
653344
public function convertFileSourceToUuid(EncodePropertyValueFromWidgetEvent $event)
    {
        if (!$this->scopeDeterminator->currentScopeIsBackend()) {
            return;
        }

        $propertiesDefinition = $event->getEnvironment()->getDataDefinition()->getPropertiesDefinition();
        $property             = $propertiesDefinition->getProperty($event->getProperty());


        if (!\array_key_exists('rte', $property->getExtra())
            || (0 !== \strpos($property->getExtra()['rte'], 'tiny'))
        ) {
            return;
        }

        $event->setValue(
            StringUtil::srcToInsertTag($event->getValue())
        );
    }
869092
public void encodeToStream(Encoder thisInstance, CharSequence source, int offset, int len, EncodedAppender appender,
            EncodingState encodingState) throws IOException {
        appender.appendEncoded(thisInstance, encodingState, source, offset, len);
    }
928306
public function setCodeDefinition(CodeDefinition $codeDef)
    {
        $this->codeDefinition = $codeDef;
        $this->setTagName($codeDef->getTagName());
    }
1231079
private void encodePair(StringBuffer result, String name, Object value, boolean first) {
    if (!first)
      result.append('&');
    URLEncode(result, name);
    result.append('=');
    encodeObject(result, value);
  }
198034
private void encodeThis() throws IOException {
        if (require == -1 && inhibit == -1) {
            this.extensionValue = null;
            return;
        }
        DerOutputStream tagged = new DerOutputStream();
        DerOutputStream seq = new DerOutputStream();

        if (require != -1) {
            DerOutputStream tmp = new DerOutputStream();
            tmp.putInteger(require);
            tagged.writeImplicit(DerValue.createTag(DerValue.TAG_CONTEXT,
                         false, TAG_REQUIRE), tmp);
        }
        if (inhibit != -1) {
            DerOutputStream tmp = new DerOutputStream();
            tmp.putInteger(inhibit);
            tagged.writeImplicit(DerValue.createTag(DerValue.TAG_CONTEXT,
                         false, TAG_INHIBIT), tmp);
        }
        seq.write(DerValue.tag_Sequence, tagged);
        this.extensionValue = seq.toByteArray();
    }
428630
public function encodeMarker(Marker $marker, Encoder $encoder)
    {
        return sprintf(
            '%s = L.marker(%s);',
            $encoder->encodeReference($marker),
            $encoder->encodeArguments(
                array(
                    $marker->getLatLng(),
                    $marker->getOptions()
                )
            )
        );
    }
145303
public function encodeDivIcon(DivIcon $icon, Encoder $encoder)
    {
        return sprintf(
            '%s = L.divIcon(%s);',
            $encoder->encodeReference($icon),
            $encoder->encodeArguments(array($icon->getOptions()))
        );
    }
1212784
function Encoder (opts) {
  if (!(this instanceof Encoder)) {
    return new Encoder(opts);
  }
  Transform.call(this, opts);

  // lame malloc()s the "gfp" buffer
  this.gfp = binding.lame_init();

  // set default options
  if (!opts) opts = {};
  if (null == opts.channels) opts.channels = 2;
  if (null == opts.bitDepth) opts.bitDepth = 16;
  if (null == opts.sampleRate) opts.sampleRate = 44100;
  if (null == opts.signed) opts.signed = opts.bitDepth != 8;

  if (opts.float && opts.bitDepth == DOUBLE_BITS) {
    this.inputType = PCM_TYPE_DOUBLE;
  } else if (opts.float && opts.bitDepth == FLOAT_BITS) {
    this.inputType = PCM_TYPE_FLOAT;
  } else if (!opts.float && opts.bitDepth == SHORT_BITS) {
    this.inputType = PCM_TYPE_SHORT_INT;
  } else {
    throw new Error('unsupported PCM format!');
  }

  // copy over opts to the encoder instance
  Object.keys(opts).forEach(function(key){
    if (key[0] != '_' && Encoder.prototype.hasOwnProperty(key)) {
      debug('setting opt %j', key);
      this[key] = opts[key];
    }
  }, this);
}
533105
private function doVectorEncode($type, Vector $vector, Encoder $builder)
    {
        return sprintf(
            '%s = L.%s(%s, %s);',
            $builder->encodeReference($vector),
            $type,
            $builder->encodeArray($vector->getLatLngs()),
            $builder->encodeValue($vector->getOptions())
        );
    }
75711
public void setEncodedBy(String encBy)
	{
		if (allow(ID3V2))
		{
			id3v2.setTextFrame(ID3v2Frames.ENCODED_BY, encBy);
		}
	}
71517
@Override
    public final void writeTypedElement(AsciiValueEncoder enc)
        throws IOException
    {
        if (mOut == null) {
            return;
        }

        int free = mOutputBufLen - mOutputPtr;
        if (enc.bufferNeedsFlush(free)) {
            flush();
        }
        while (true) {
            mOutputPtr = enc.encodeMore(mOutputBuffer, mOutputPtr, mOutputBufLen);
            // If no flushing needed, indicates that all data was encoded
            if (enc.isCompleted()) {
                break;
            }
            flush();
        }
    }