Package org.grails.buffer
Class StreamCharBuffer.StreamCharBufferWriter
- java.lang.Object
-
- java.io.Writer
-
- org.grails.buffer.StreamCharBuffer.StreamCharBufferWriter
-
- All Implemented Interfaces:
java.io.Closeable,java.io.Flushable,java.lang.Appendable,java.lang.AutoCloseable,EncodedAppenderFactory,EncodedAppenderWriterFactory
- Enclosing class:
- StreamCharBuffer
public final class StreamCharBuffer.StreamCharBufferWriter extends java.io.Writer implements EncodedAppenderFactory, EncodedAppenderWriterFactory
This is the java.io.Writer implementation for StreamCharBuffer
-
-
Constructor Summary
Constructors Constructor Description StreamCharBufferWriter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.io.Writerappend(java.lang.CharSequence csq)java.io.Writerappend(java.lang.CharSequence csq, int start, int end)voidappend(EncodingState encodingState, char character)protected voidappendCharSequence(EncodingState encodingState, java.lang.CharSequence csq, int start, int end)voidclose()voidflush()StreamCharBuffergetBuffer()EncodedAppendergetEncodedAppender()Gets the EncodedAppender that is connected to the instance of this implementation.java.io.WritergetWriterForEncoder(Encoder encoder, EncodingStateRegistry encodingStateRegistry)Gets the EncodedAppenderWriter instance that is connected to this instance implementation with a certain encoder fixed.booleanisClosed()booleanisUsed()voidmarkUsed()intresetUsed()voidwrite(char[] b, int off, int len)voidwrite(int b)voidwrite(java.lang.String str)voidwrite(java.lang.String str, int off, int len)voidwrite(StreamCharBuffer subBuffer)voidwrite(StreamCharBuffer subBuffer, java.util.List<Encoder> encoders)
-
-
-
Method Detail
-
write
public final void write(char[] b, int off, int len) throws java.io.IOException- Specified by:
writein classjava.io.Writer- Throws:
java.io.IOException
-
write
public final void write(java.lang.String str) throws java.io.IOException- Overrides:
writein classjava.io.Writer- Throws:
java.io.IOException
-
write
public final void write(java.lang.String str, int off, int len) throws java.io.IOException- Overrides:
writein classjava.io.Writer- Throws:
java.io.IOException
-
write
public final void write(StreamCharBuffer subBuffer) throws java.io.IOException
- Throws:
java.io.IOException
-
write
public final void write(StreamCharBuffer subBuffer, java.util.List<Encoder> encoders) throws java.io.IOException
- Throws:
java.io.IOException
-
append
public final java.io.Writer append(java.lang.CharSequence csq, int start, int end) throws java.io.IOException- Specified by:
appendin interfacejava.lang.Appendable- Overrides:
appendin classjava.io.Writer- Throws:
java.io.IOException
-
appendCharSequence
protected void appendCharSequence(EncodingState encodingState, java.lang.CharSequence csq, int start, int end) throws java.io.IOException
- Throws:
java.io.IOException
-
append
public final java.io.Writer append(java.lang.CharSequence csq) throws java.io.IOException- Specified by:
appendin interfacejava.lang.Appendable- Overrides:
appendin classjava.io.Writer- Throws:
java.io.IOException
-
close
public void close() throws java.io.IOException- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Specified by:
closein classjava.io.Writer- Throws:
java.io.IOException
-
isClosed
public boolean isClosed()
-
isUsed
public boolean isUsed()
-
markUsed
public final void markUsed()
-
resetUsed
public int resetUsed()
-
write
public void write(int b) throws java.io.IOException- Overrides:
writein classjava.io.Writer- Throws:
java.io.IOException
-
getBuffer
public final StreamCharBuffer getBuffer()
-
append
public void append(EncodingState encodingState, char character) throws java.io.IOException
- Throws:
java.io.IOException
-
getWriterForEncoder
public java.io.Writer getWriterForEncoder(Encoder encoder, EncodingStateRegistry encodingStateRegistry)
Description copied from interface:EncodedAppenderWriterFactoryGets the EncodedAppenderWriter instance that is connected to this instance implementation with a certain encoder fixed.- Specified by:
getWriterForEncoderin interfaceEncodedAppenderWriterFactory- Parameters:
encoder- the encoder to useencodingStateRegistry- the current EncodingStateRegistry to use- Returns:
- the java.io.Writer instance
-
getEncodedAppender
public EncodedAppender getEncodedAppender()
Description copied from interface:EncodedAppenderFactoryGets the EncodedAppender that is connected to the instance of this implementation.- Specified by:
getEncodedAppenderin interfaceEncodedAppenderFactory- Returns:
- the EncodedAppender
-
flush
public void flush() throws java.io.IOException- Specified by:
flushin interfacejava.io.Flushable- Specified by:
flushin classjava.io.Writer- Throws:
java.io.IOException
-
-