net.sf.cotta.io
Class InputManager

java.lang.Object
  extended by net.sf.cotta.io.ResourceManager<InputProcessor>
      extended by net.sf.cotta.io.InputManager

public class InputManager
extends ResourceManager<InputProcessor>

InputManager for input resource management. This class is to be used through Input


Constructor Summary
protected InputManager(InputStreamFactory streamFactory, java.lang.String defaultEncoding)
           
 
Method Summary
 java.io.BufferedReader bufferedReader()
           
 java.nio.channels.FileChannel channel()
           
 void clean(java.nio.MappedByteBuffer buffer)
          Clean up the mapped byte buffer so that the mapped file can be accessed.
 java.io.InputStream inputStream()
           
 java.io.LineNumberReader lineNumberReader()
           
protected  TPath path()
           
protected  void process(InputProcessor processor)
           
 java.io.Reader reader()
           
 java.io.Reader reader(java.lang.String encoding)
           
static Input with(java.io.InputStream stream)
          Deprecated. Moved to Input
static Input with(InputStreamFactory streamFactory)
          Deprecated. Moved to Input
static Input with(InputStreamFactory streamFactory, java.lang.String encoding)
          Deprecated. Moved to Input
static Input with(java.io.InputStream stream, java.lang.String encoding)
          Deprecated. Moved to Input
 
Methods inherited from class net.sf.cotta.io.ResourceManager
open, registerResource
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InputManager

protected InputManager(InputStreamFactory streamFactory,
                       java.lang.String defaultEncoding)
Method Detail

inputStream

public java.io.InputStream inputStream()
                                throws TIoException
Throws:
TIoException

reader

public java.io.Reader reader()
                      throws TIoException
Throws:
TIoException

reader

public java.io.Reader reader(java.lang.String encoding)
                      throws TIoException
Throws:
TIoException

bufferedReader

public java.io.BufferedReader bufferedReader()
                                      throws TIoException
Throws:
TIoException

lineNumberReader

public java.io.LineNumberReader lineNumberReader()
                                          throws TIoException
Throws:
TIoException

channel

public java.nio.channels.FileChannel channel()
                                      throws TIoException
Throws:
TIoException

process

protected void process(InputProcessor processor)
                throws java.io.IOException
Specified by:
process in class ResourceManager<InputProcessor>
Throws:
java.io.IOException

path

protected TPath path()
Specified by:
path in class ResourceManager<InputProcessor>

clean

public void clean(java.nio.MappedByteBuffer buffer)
Clean up the mapped byte buffer so that the mapped file can be accessed. This is a work around so use it at your own risk. See orinigar bug for its source and context.

Parameters:
buffer - the buffer to clean up

with

@Deprecated
public static Input with(java.io.InputStream stream)
Deprecated. Moved to Input

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

@Deprecated
public static Input with(java.io.InputStream stream,
                                    java.lang.String encoding)
Deprecated. Moved to Input

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

@Deprecated
public static Input with(InputStreamFactory streamFactory)
Deprecated. Moved to Input

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

@Deprecated
public static Input with(InputStreamFactory streamFactory,
                                    java.lang.String encoding)
Deprecated. Moved to Input

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