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 aBufferSimpleWriter
with a writer. -
Method Summary
Modifier and TypeMethodDescriptionappend
(CharSequence csq, int start, int end) Get theWriter
.void
newLine()
Write a newline according to the characteristics of the target platform.void
write
(char c) Write a character.void
write
(char[] cbuf, int offset, int len) Write a sequence of characters from an array.void
write
(int num) Write an integer.void
Write a character sequence.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.sf.carte.util.SimpleWriter
append, append, getLastChar, unwrite, unwrite
-
Constructor Details
-
DefaultSimpleWriter
Initializes aBufferSimpleWriter
with a writer.- Parameters:
writer
- the writer.
-
-
Method Details
-
getWriter
Get theWriter
.- Returns:
- the writer.
-
newLine
Description copied from interface:SimpleWriter
Write a newline according to the characteristics of the target platform.- Specified by:
newLine
in interfaceSimpleWriter
- Throws:
IOException
- if an error happens when writing.
-
write
Description copied from interface:SimpleWriter
Write a character sequence.- Specified by:
write
in interfaceSimpleWriter
- Parameters:
s
- the CharSequence.- Throws:
IOException
- if an error happens when writing.
-
write
Description copied from interface:SimpleWriter
Write a sequence of characters from an array.- Specified by:
write
in 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:
append
in interfaceAppendable
- Specified by:
append
in interfaceSimpleWriter
- Throws:
IOException
-
write
Description copied from interface:SimpleWriter
Write a character.- Specified by:
write
in interfaceSimpleWriter
- Parameters:
c
- the character.- Throws:
IOException
- if an error happens when writing.
-
write
Description copied from interface:SimpleWriter
Write an integer.- Specified by:
write
in interfaceSimpleWriter
- Parameters:
num
- the integer number.- Throws:
IOException
- if an error happens when writing.
-