Encodes a Cut operation.

@param part
Reference to the Cut operation

@throws EncodingException
if the encoding failed
427925
private void encodeCut(final DiffPart part)
		throws EncodingException
	{

		// C
		data.writeBit(1);
		data.writeBit(0);
		data.writeBit(1);

		// S
		data.writeValue(codecData.getBlocksizeS(), part.getStart());

		// E
		data.writeValue(codecData.getBlocksizeE(), part.getLength());

		// B
		data.writeValue(codecData.getBlocksizeB(),
				Integer.parseInt(part.getText()));

		data.writeFillBits();

	}
1193611
void preProcessOperation(StreamSegmentTruncateOperation operation) throws BadOffsetException {
        ensureSegmentId(operation);
        if (operation.getStreamSegmentOffset() < this.startOffset || operation.getStreamSegmentOffset() > this.length) {
            String msg = String.format("Truncation Offset must be at least %d and at most %d, given %d.",
                                       this.startOffset, this.length, operation.getStreamSegmentOffset());
            throw new BadOffsetException(this.name, this.startOffset, operation.getStreamSegmentOffset(), msg);
        }
    }
385753
private function getEncoder(Email\Part $part)
    {
        $encoding = $part->getEncoding();
        if (null === $encoding) {
            return null;
        }

        switch ($encoding) {
            case Email::ENCODING_BASE64:
                return \Swift_Encoding::getBase64Encoding();

            case Email::ENCODING_QUOTED_PRINTABLE:
                return \Swift_Encoding::getQpEncoding();

            case Email::ENCODING_8BIT:
                return \Swift_Encoding::get8BitEncoding();

            case Email::ENCODING_7BIT:
                return \Swift_Encoding::get7BitEncoding();

            case Email::ENCODING_RAW:
                return new \Swift_Mime_ContentEncoder_RawContentEncoder();

            default:
                throw new UnknownEmailEncodingException($encoding);
        }
    }
558051
static String encFragment(final String content, final Charset charset) {
		return urlencode(content, charset, FRAGMENT, false);
	}
317730
@Override
    protected void write(EncodingState encodingState, char[] b, int off, int len) throws IOException {
        target.write(b, off, len);
    }
1214344
public void setResponseCharacterEncoding(String encoding)
    {
        ExternalContext ctx = _MyFacesExternalContextHelper.firstInstance.get();
        
        if (ctx == null)
        {
            throw new UnsupportedOperationException();
        }
        
        ctx.setResponseCharacterEncoding(encoding);
    }
80682
private void encodeThis() throws IOException {
        DerOutputStream os = new DerOutputStream();
        os.putTruncatedUnalignedBitString(new BitArray(this.bitString));
        this.extensionValue = os.toByteArray();
    }
857051
public void encodeData(AsnOutputStream asnOs) throws MAPException {

        if (this.ssCode == null)
            throw new MAPException("Error while encoding " + _PrimitiveName + ": ssCode required.");

        if (this.callBarringFeatureList == null)
            throw new MAPException("Error while encoding " + _PrimitiveName + ": callBarringFeatureList required.");

        if (this.callBarringFeatureList.size() < 1 || this.callBarringFeatureList.size() > 32) {
            throw new MAPException("Error while encoding " + _PrimitiveName
                    + ": Parameter callBarringFeatureList size must be from 1 to 32, found: "
                    + this.callBarringFeatureList.size());
        }

        try {

            ((SSCodeImpl) this.ssCode).encodeAll(asnOs);

            asnOs.writeTag(Tag.CLASS_UNIVERSAL, false, Tag.SEQUENCE);
            int pos = asnOs.StartContentDefiniteLength();
            for (ExtCallBarringFeature featureItem : this.callBarringFeatureList) {
                ((ExtCallBarringFeatureImpl) featureItem).encodeAll(asnOs);
            }
            asnOs.FinalizeContent(pos);

            if (this.extensionContainer != null)
                ((MAPExtensionContainerImpl) this.extensionContainer).encodeAll(asnOs);
        } catch (AsnException e) {
            throw new MAPException("AsnException when encoding " + _PrimitiveName + ": " + e.getMessage(), e);
        }
    }
982383
public void encodeData(AsnOutputStream asnOs) throws MAPException {
        if (this.deferredLocationEventType == null) {
            throw new MAPException("Encdoing of " + _PrimitiveName
                    + " failed. Missing mandatory parameter deferredLocationEventType DeferredLocationEventType");
        }

        ((DeferredLocationEventTypeImpl) this.deferredLocationEventType).encodeAll(asnOs);

        if (this.terminationCause != null) {
            try {
                asnOs.writeInteger(Tag.CLASS_CONTEXT_SPECIFIC, _TAG_TERMINATION_CAUSE, this.terminationCause.getCause());
            } catch (IOException e) {
                throw new MAPException("IOException when encoding " + _PrimitiveName + ".terminationCause: " + e.getMessage(),
                        e);
            } catch (AsnException e) {
                throw new MAPException("AsnException when encoding " + _PrimitiveName + ".terminationCause: " + e.getMessage(),
                        e);
            }
        }

        if (this.lcsLocationInfo != null) {
            ((LCSLocationInfoImpl) this.lcsLocationInfo).encodeAll(asnOs, Tag.CLASS_CONTEXT_SPECIFIC, _TAG_LCS_LOCATION_INFO);
        }
    }
206039
public void setOutputEncoding(String outputEncoding) {
        this.log("Setting output encoding to " + outputEncoding, LogLevel.DEBUG.getLevel());
        this.outputEncoding = outputEncoding;
    }
843530
@Override
    public void encodeTo(FLEncoder enc) {
        final Encoder encoder = new Encoder(enc);
        internalDict.encodeTo(encoder);
        encoder.release();
    }
919177
@Override
    public void write(String str, int off, int len) throws IOException {
        encodedAppender.append(
                encoder,
                (encodingStateRegistry != null && off == 0 && len == str.length()) ? encodingStateRegistry
                        .getEncodingStateFor(str) : null, str, off, len);
    }
1192317
public void setFragment(String fragment) throws URIException {
        if (fragment == null || fragment.length() == 0) {
            _fragment = (fragment == null) ? null : fragment.toCharArray();
            hash = 0;
            return;
        }
        _fragment = encode(fragment, allowed_fragment, getProtocolCharset());
        hash = 0;
    }
1103768
private void encodeFullRevisionUncompressed(final DiffPart part)
		throws UnsupportedEncodingException, EncodingException
	{

		// C
		data.writeBit(0);
		data.writeBit(0);
		data.writeBit(1);

		// L T
		String text = part.getText();
		byte[] bText = text.getBytes(WIKIPEDIA_ENCODING);

		data.writeValue(codecData.getBlocksizeL(), bText.length);
		data.write(bText);

	}
246826
public static String encodeQuery(String query, String encoding) throws UnsupportedEncodingException {
		return HierarchicalUriComponents.encodeUriComponent(query, encoding, HierarchicalUriComponents.Type.QUERY);
	}
791694
private void encode(long bits, StringBuilder sb) {
        if (bits < 0) {
            sb.append(characters[(int) ((bits % base + base) % base)]);

            bits /= -base;
        }

        while (bits > 0) {
            sb.append(characters[(int) (bits % base)]);

            bits /= base;
        }
    }
647734
private int generatePropertyEncodeDecode(
        final Token token,
        final String typeName,
        final StringBuilder encode,
        final StringBuilder decode,
        final int currentOffset)
    {
        final char varName = Character.toLowerCase(typeName.charAt(0));
        final String propertyName = formatPropertyName(token.name());
        final int gap = token.offset() - currentOffset;
        encode.append(generateEncodeOffset(gap, ""));
        decode.append(generateDecodeOffset(gap, ""));

        encode.append(String.format(
            "\tif err := %1$s.%2$s.Encode(_m, _w); err != nil {\n" +
            "\t\treturn err\n" +
            "\t}\n",
            varName,
            propertyName));

        decode.append(String.format(
            "\tif %1$s.%2$sInActingVersion(actingVersion) {\n" +
            "\t\tif err := %1$s.%2$s.Decode(_m, _r, actingVersion); err != nil {\n" +
            "\t\t\treturn err\n" +
            "\t\t}\n" +
            "\t}\n",
            varName,
            propertyName));

        return token.encodedLength() + gap;
    }