things.common.tools
Class StringArrayReader

java.lang.Object
  extended by java.io.Reader
      extended by things.common.tools.StringArrayReader
All Implemented Interfaces:
java.io.Closeable, java.lang.Readable

public class StringArrayReader
extends java.io.Reader

This will read an array of strings.

Version:
1.0
Version History
EPG - Rewrite - 6 May 06
Author:
Erich P. Gatejen

Field Summary
 
Fields inherited from class java.io.Reader
lock
 
Constructor Summary
StringArrayReader(java.lang.String[] inData, boolean spaceDelimit)
          Construct.
 
Method Summary
 void close()
          Close.
 int read()
          Read a single character.
 int read(char[] cbuf, int off, int len)
          Read into a buffer.
 
Methods inherited from class java.io.Reader
mark, markSupported, read, read, ready, reset, skip
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StringArrayReader

public StringArrayReader(java.lang.String[] inData,
                         boolean spaceDelimit)
                  throws java.lang.Throwable
Construct. Use the data passed.

Parameters:
inData - The data to read.
spaceDelimit - simulate a space between each array element.
Throws:
java.lang.Throwable - if the data is not allowed.
Method Detail

read

public int read(char[] cbuf,
                int off,
                int len)
         throws java.io.IOException
Read into a buffer.

Specified by:
read in class java.io.Reader
Parameters:
cbuf - Destination buffer
off - Offset at which to start storing characters
len - Maximum number of characters to read
Throws:
java.io.IOException
See Also:
Reader.read(char[], int, int)

read

public int read()
         throws java.io.IOException
Read a single character. Returns -1 when the reader is empty.

Overrides:
read in class java.io.Reader
Returns:
the character.
Throws:
Not - really anything, ever.
java.io.IOException
See Also:
Reader.read()

close

public void close()
           throws java.io.IOException
Close. It's a NOOP.

Specified by:
close in interface java.io.Closeable
Specified by:
close in class java.io.Reader
Throws:
java.io.IOException


Things.