net.sf.cotta.io
Class Input

java.lang.Object
  extended by net.sf.cotta.io.Input

public class Input
extends java.lang.Object

Input processing class used to expose the API in the right context


Constructor Summary
Input(InputManager manager)
           
 
Method Summary
 void read(InputProcessor processor)
          Read the file with an input processor
 void readLines(LineProcessor lineProcessor)
          Read the file with a line processor
static Input with(java.io.InputStream stream)
          A static factory to create an Input instance for processing the input stream with system default encoding
static Input with(InputStreamFactory streamFactory)
          A static factory to create an Input instance for processing the input stream to be created by the InputStreamFactory with system default encoding
static Input with(InputStreamFactory streamFactory, java.lang.String encoding)
          A static factory to create an Input instance for processing the input stream to be created by the InputStreamFactory with provided encoding
static Input with(java.io.InputStream stream, java.lang.String encoding)
          A static factory to create an Input instance for processing the input stream with the given encoding when creating readers
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Input

public Input(InputManager manager)
Method Detail

read

public void read(InputProcessor processor)
          throws TIoException
Read the file with an input processor

Parameters:
processor - processor for the input
Throws:
TIoException - error in reading the file

readLines

public void readLines(LineProcessor lineProcessor)
               throws TIoException
Read the file with a line processor

Parameters:
lineProcessor - line processor for the lines
Throws:
TIoException - error in reading the file

with

public static Input with(java.io.InputStream stream)
A static factory to create an Input instance for processing the input stream with system default encoding

Parameters:
stream - the input stream to process
Returns:
The Input instance

with

public static Input with(java.io.InputStream stream,
                         java.lang.String encoding)
A static factory to create an Input instance for processing the input stream with the given encoding when creating readers

Parameters:
stream - the input stream to process
encoding - encoding used when creating readers
Returns:
The Input instance

with

public static Input with(InputStreamFactory streamFactory)
A static factory to create an Input instance for processing the input stream to be created by the InputStreamFactory with system default encoding

Parameters:
streamFactory - input stream factory
Returns:
the Input instance

with

public static Input with(InputStreamFactory streamFactory,
                         java.lang.String encoding)
A static factory to create an Input instance for processing the input stream to be created by the InputStreamFactory with provided encoding

Parameters:
streamFactory - input stream factory
encoding - encoding used to create readers
Returns:
the Input instance