net.sf.mmm.util.io.base
Class AppendableWriter

java.lang.Object
  extended by java.io.Writer
      extended by net.sf.mmm.util.io.base.AppendableWriter
All Implemented Interfaces:
Closeable, Flushable, Appendable
Direct Known Subclasses:
NlsWriter

public class AppendableWriter
extends Writer

This class is a Writer that adapts an Appendable.

Since:
2.0.0
Author:
Joerg Hohwiller (hohwille at users.sourceforge.net)

Field Summary
private  Appendable appendable
          The delegate.
 
Fields inherited from class java.io.Writer
lock
 
Constructor Summary
AppendableWriter(Appendable appendable)
          The constructor.
 
Method Summary
 AppendableWriter append(char c)
          
 AppendableWriter append(CharSequence csq)
          
 AppendableWriter append(CharSequence csq, int start, int end)
          
 void close()
          
 void flush()
          
 Appendable getAppendable()
          This method gets the Appendable to delegate to.
 void write(char[] buffer)
          
 void write(char[] buffer, int offset, int length)
          
 void write(String string)
          
 void write(String string, int offset, int length)
          
 
Methods inherited from class java.io.Writer
write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

appendable

private final Appendable appendable
The delegate.

Constructor Detail

AppendableWriter

public AppendableWriter(Appendable appendable)
The constructor.

Parameters:
appendable - is the Appendable to adapt.
Method Detail

close

public void close()
           throws RuntimeIoException

Specified by:
close in interface Closeable
Specified by:
close in class Writer
Throws:
RuntimeIoException

flush

public void flush()
           throws RuntimeIoException

Specified by:
flush in interface Flushable
Specified by:
flush in class Writer
Throws:
RuntimeIoException

append

public AppendableWriter append(char c)
                        throws RuntimeIoException

Specified by:
append in interface Appendable
Overrides:
append in class Writer
Throws:
RuntimeIoException

append

public AppendableWriter append(CharSequence csq)
                        throws RuntimeIoException

Specified by:
append in interface Appendable
Overrides:
append in class Writer
Throws:
RuntimeIoException

append

public AppendableWriter append(CharSequence csq,
                               int start,
                               int end)
                        throws RuntimeIoException

Specified by:
append in interface Appendable
Overrides:
append in class Writer
Throws:
RuntimeIoException

write

public void write(char[] buffer)
           throws RuntimeIoException

Overrides:
write in class Writer
Throws:
RuntimeIoException

write

public void write(String string)
           throws RuntimeIoException

Overrides:
write in class Writer
Throws:
RuntimeIoException

write

public void write(String string,
                  int offset,
                  int length)
           throws RuntimeIoException

Overrides:
write in class Writer
Throws:
RuntimeIoException

write

public void write(char[] buffer,
                  int offset,
                  int length)
           throws RuntimeIoException

Specified by:
write in class Writer
Throws:
RuntimeIoException

getAppendable

public Appendable getAppendable()
This method gets the Appendable to delegate to.

Returns:
the appendable


Copyright © 2001-2010 mmm-Team. All Rights Reserved.