org.writersforge.catalan.transform.io
Class IOAdapter

java.lang.Object
  extended byorg.writersforge.catalan.transform.io.IOAdapter

public class IOAdapter
extends java.lang.Object

Convenience class for converting I/O classes from one interface to another, for example a Reader into an InputStream.

Author:
jsheets

Constructor Summary
IOAdapter(java.lang.Object io)
          Creates a new instance of IOAdapter.
 
Method Summary
 java.io.InputStream getInputStream()
          Converts the wrapped object into an InputStream object.
 java.io.OutputStream getOutputStream()
          Converts the wrapped object into an OutputStream object.
 java.io.Reader getReader()
          Converts the wrapped object into a Reader object.
 java.io.Writer getWriter()
          Converts the wrapped object into a Writer object.
 boolean isReader()
          Determines if the wrapped object is suitable for reading from.
 boolean isWriter()
          Determines if the wrapped object is suitable for writing to.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IOAdapter

public IOAdapter(java.lang.Object io)
Creates a new instance of IOAdapter.

Parameters:
io - IO object to wrap
Method Detail

isReader

public boolean isReader()
Determines if the wrapped object is suitable for reading from.

Returns:
true if wrapped object is readable

isWriter

public boolean isWriter()
Determines if the wrapped object is suitable for writing to.

Returns:
true if wrapped object is writable

getReader

public java.io.Reader getReader()
Converts the wrapped object into a Reader object.

Returns:
a Reader or null if not adaptable

getInputStream

public java.io.InputStream getInputStream()
Converts the wrapped object into an InputStream object.

Returns:
a InputStream or null if not adaptable

getWriter

public java.io.Writer getWriter()
Converts the wrapped object into a Writer object.

Returns:
a Writer or null if not adaptable

getOutputStream

public java.io.OutputStream getOutputStream()
Converts the wrapped object into an OutputStream object.

Returns:
an OutputStream or null if not adaptable