Package org.grails.encoder
Class WriterEncodedAppender
- java.lang.Object
-
- org.grails.encoder.AbstractEncodedAppender
-
- org.grails.encoder.WriterEncodedAppender
-
- All Implemented Interfaces:
EncodedAppender
public class WriterEncodedAppender extends AbstractEncodedAppender
An EncodedAppender implementation that writes to a java.io.Writer.- Since:
- 2.3
-
-
Constructor Summary
Constructors Constructor Description WriterEncodedAppender(java.io.Writer target)Default constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidappendCharSequence(EncodingState encodingState, java.lang.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, java.lang.String str, int off, int len)Append a portion of a string to the buffer and attach the encodingState information to it-
Methods inherited from class org.grails.encoder.AbstractEncodedAppender
append, append, append, appendEncoded, appendEncoded, encodeAndWrite, isIgnoreEncodingState, setIgnoreEncodingState, shouldEncode, shouldEncodeWith
-
-
-
-
Method Detail
-
flush
public void flush() throws java.io.IOExceptionDescription copied from interface:EncodedAppenderFlush the internal buffer and write the buffered input to a possible destination.- Specified by:
flushin interfaceEncodedAppender- Overrides:
flushin classAbstractEncodedAppender- Throws:
java.io.IOException- Signals that an I/O exception has occurred.
-
write
protected void write(EncodingState encodingState, char[] b, int off, int len) throws java.io.IOException
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:
java.io.IOException- Signals that an I/O exception has occurred.
-
write
protected void write(EncodingState encodingState, java.lang.String str, int off, int len) throws java.io.IOException
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:
java.io.IOException- Signals that an I/O exception has occurred.
-
appendCharSequence
protected void appendCharSequence(EncodingState encodingState, java.lang.CharSequence csq, int start, int end) throws java.io.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:
java.io.IOException- Signals that an I/O exception has occurred.
-
close
public void close() throws java.io.IOException- Throws:
java.io.IOException
-
createNewEncodingState
protected EncodingState createNewEncodingState(Encoder encoder, EncodingState encodingState)
- Overrides:
createNewEncodingStatein classAbstractEncodedAppender
-
-