Package org.grails.encoder
Class WriterEncodedAppender
java.lang.Object
org.grails.encoder.AbstractEncodedAppender
org.grails.encoder.WriterEncodedAppender
- All Implemented Interfaces:
EncodedAppender
An EncodedAppender implementation that writes to a java.io.Writer.
- Since:
- 2.3
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidappendCharSequence(EncodingState encodingState, CharSequence csq, int start, int end) Append a portion of a CharSequence to the buffer and attach the encodingState information to itvoidclose()protected EncodingStatecreateNewEncodingState(Encoder encoder, EncodingState encodingState) voidflush()Flush the internal buffer and write the buffered input to a possible destination.protected voidwrite(EncodingState encodingState, char[] b, int off, int len) Append a portion of a char array to the buffer and attach the encodingState information to itprotected voidwrite(EncodingState encodingState, String str, int off, int len) Append a portion of a string to the buffer and attach the encodingState information to itMethods inherited from class org.grails.encoder.AbstractEncodedAppender
append, append, append, appendEncoded, appendEncoded, encodeAndWrite, isIgnoreEncodingState, setIgnoreEncodingState, shouldEncode, shouldEncodeWith
-
Constructor Details
-
WriterEncodedAppender
Default constructor.- Parameters:
target- the target writer
-
-
Method Details
-
flush
Description copied from interface:EncodedAppenderFlush the internal buffer and write the buffered input to a possible destination.- Specified by:
flushin interfaceEncodedAppender- Overrides:
flushin classAbstractEncodedAppender- Throws:
IOException- Signals that an I/O exception has occurred.
-
write
Description copied from class:AbstractEncodedAppenderAppend a portion of a char array to the buffer and attach the encodingState information to it- Specified by:
writein classAbstractEncodedAppender- Parameters:
encodingState- the new encoding state of the char arrayb- a char arrayoff- Offset from which to start encoding characterslen- Number of characters to encode- Throws:
IOException- Signals that an I/O exception has occurred.
-
write
Description copied from class:AbstractEncodedAppenderAppend a portion of a string to the buffer and attach the encodingState information to it- Specified by:
writein classAbstractEncodedAppender- Parameters:
encodingState- the new encoding state of the stringstr- A Stringoff- Offset from which to start encoding characterslen- Number of characters to encode- Throws:
IOException- Signals that an I/O exception has occurred.
-
appendCharSequence
protected void appendCharSequence(EncodingState encodingState, CharSequence csq, int start, int end) throws IOException Description copied from class:AbstractEncodedAppenderAppend a portion of a CharSequence to the buffer and attach the encodingState information to it- Specified by:
appendCharSequencein classAbstractEncodedAppender- Parameters:
encodingState- the new encoding state of the CharSequence portioncsq- a CharSequencestart- the start index, inclusiveend- the end index, exclusive- Throws:
IOException- Signals that an I/O exception has occurred.
-
close
- Throws:
IOException
-
createNewEncodingState
- Overrides:
createNewEncodingStatein classAbstractEncodedAppender
-