java.lang.Object
io.sf.carte.util.DefaultSimpleWriter
- All Implemented Interfaces:
SimpleWriter,Appendable
An implementation of
SimpleWriter backed by a Writer.-
Constructor Summary
ConstructorsConstructorDescriptionDefaultSimpleWriter(Writer writer) Initializes aBufferSimpleWriterwith a writer. -
Method Summary
Modifier and TypeMethodDescriptionappend(CharSequence csq, int start, int end) Get theWriter.voidnewLine()Write a newline according to the characteristics of the target platform.voidwrite(char c) Write a character.voidwrite(char[] cbuf, int offset, int len) Write a sequence of characters from an array.voidwrite(int num) Write an integer.voidWrite a character sequence.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.sf.carte.util.SimpleWriter
append, append, getLastChar, unwrite, unwrite
-
Constructor Details
-
DefaultSimpleWriter
Initializes aBufferSimpleWriterwith a writer.- Parameters:
writer- the writer.
-
-
Method Details
-
getWriter
Get theWriter.- Returns:
- the writer.
-
newLine
Description copied from interface:SimpleWriterWrite a newline according to the characteristics of the target platform.- Specified by:
newLinein interfaceSimpleWriter- Throws:
IOException- if an error happens when writing.
-
write
Description copied from interface:SimpleWriterWrite a character sequence.- Specified by:
writein interfaceSimpleWriter- Parameters:
s- the CharSequence.- Throws:
IOException- if an error happens when writing.
-
write
Description copied from interface:SimpleWriterWrite a sequence of characters from an array.- Specified by:
writein interfaceSimpleWriter- Parameters:
cbuf- the character array.offset- the offset to start writing.len- the number of characters to write from the array.- Throws:
IOException- if an error happens when writing.
-
append
- Specified by:
appendin interfaceAppendable- Specified by:
appendin interfaceSimpleWriter- Throws:
IOException
-
write
Description copied from interface:SimpleWriterWrite a character.- Specified by:
writein interfaceSimpleWriter- Parameters:
c- the character.- Throws:
IOException- if an error happens when writing.
-
write
Description copied from interface:SimpleWriterWrite an integer.- Specified by:
writein interfaceSimpleWriter- Parameters:
num- the integer number.- Throws:
IOException- if an error happens when writing.
-