Package org.grails.encoder
Interface StreamingEncoder
- All Superinterfaces:
CodecIdentifierProvider,Encoder
- All Known Implementing Classes:
AbstractCharReplacementEncoder,BasicJSONEncoder,BasicXMLEncoder,ChainedEncoder,HTML4Encoder,HTMLEncoder,JavaScriptEncoder,NoneEncoder,RawCodec
Streaming encoder interface that makes it possible to encode a portion of a
CharSequence and append it directly to the EncodedAppender instance. This
solution makes it possible to just check if the input is ok and only replace
the characters in the input that have to be escaped.
- Since:
- 2.3
-
Method Summary
Modifier and TypeMethodDescriptionvoidencodeToStream(Encoder thisInstance, CharSequence source, int offset, int len, EncodedAppender appender, EncodingState encodingState) Encode and append portion of source CharSequence to the appender.Methods inherited from interface org.grails.encoder.CodecIdentifierProvider
getCodecIdentifierMethods inherited from interface org.grails.encoder.Encoder
encode, isApplyToSafelyEncoded, isSafe, markEncoded
-
Method Details
-
encodeToStream
void encodeToStream(Encoder thisInstance, CharSequence source, int offset, int len, EncodedAppender appender, EncodingState encodingState) throws IOException Encode and append portion of source CharSequence to the appender.- Parameters:
source- The source CharSequenceoffset- Offset from which to start encoding characterslen- Number of characters to encodeappender- the appender to write toencodingState- the current encoding state- Throws:
IOException- Signals that an I/O exception has occurred.
-