org.openmdx.base.stream.rmi.cci
Class CharacterSource_1Reader

java.lang.Object
  extended by java.io.Reader
      extended by org.openmdx.base.stream.rmi.cci.CharacterSource_1Reader
All Implemented Interfaces:
Closeable, Readable, Source_1_0

public class CharacterSource_1Reader
extends Reader
implements Source_1_0

Streams: Character Source Reader


Field Summary
protected  ExecutionContext callbackContext
          Callback Context
protected  int capacity
          The stream's actual capacity
protected static int DEFAULT_CAPACITY
          The stream's default capacity
protected  CharacterSource_1_0 in
           
 
Fields inherited from class java.io.Reader
lock
 
Constructor Summary
CharacterSource_1Reader(CharacterSource_1_0 source, ExecutionContext callbackContext)
          Constructor
CharacterSource_1Reader(CharacterSource_1_0 source, int capacity, ExecutionContext callbackContext)
          Constructor
 
Method Summary
 void close()
          Closes this iterator and releases any system resources associated with it.
protected  boolean isOpen()
           
 long length()
          Get the stream's length
 int read(char[] destination, int offset, int length)
          Read characters into a portion of an array.
 
Methods inherited from class java.io.Reader
mark, markSupported, read, read, read, ready, reset, skip
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

in

protected CharacterSource_1_0 in

DEFAULT_CAPACITY

protected static int DEFAULT_CAPACITY
The stream's default capacity


capacity

protected final int capacity
The stream's actual capacity


callbackContext

protected final ExecutionContext callbackContext
Callback Context

Constructor Detail

CharacterSource_1Reader

public CharacterSource_1Reader(CharacterSource_1_0 source,
                               int capacity,
                               ExecutionContext callbackContext)
Constructor

Parameters:
source -
capacity -
callbackContext - The execution context for callbacks

CharacterSource_1Reader

public CharacterSource_1Reader(CharacterSource_1_0 source,
                               ExecutionContext callbackContext)
Constructor

Parameters:
source -
callbackContext - The execution context for callbacks
Method Detail

isOpen

protected boolean isOpen()

length

public long length()
            throws IOException
Get the stream's length

Specified by:
length in interface Source_1_0
Returns:
the length of the stream or -1 if it is unknown.
Throws:
IOException

close

public void close()
           throws IOException
Description copied from interface: Source_1_0
Closes this iterator and releases any system resources associated with it.

No read() operation must be invoked after close().

Specified by:
close in interface Closeable
Specified by:
close in interface Source_1_0
Specified by:
close in class Reader
Throws:
IOException - if an I/O error occurs.

read

public int read(char[] destination,
                int offset,
                int length)
         throws IOException
Read characters into a portion of an array. This method will block until some input is available, an I/O error occurs, or the end of the stream is reached.

Specified by:
read in class Reader
Parameters:
destination - Destination buffer
offset - Offset at which to start storing characters
length - Maximum number of characters to read
Throws:
IOException


This software is published under the BSD license. Copyright © 2003-2007, OMEX AG, Switzerland, All rights reserved. Use is subject to license terms.