com.ibm.as400.access
Class ConvTableReader

java.lang.Object
  |
  +--java.io.Reader
        |
        +--java.io.InputStreamReader
              |
              +--com.ibm.as400.access.ConvTableReader

public class ConvTableReader
extends java.io.InputStreamReader

Internal class representing a Toolbox converter that uses stateful character conversion. That is, it wraps an underlying InputStream and reads/caches the appropriate number of bytes to return the requested number of Unicode characters. This is especially useful for mixed byte tables where the number of converted Unicode characters is almost never the same as the number of underlying EBCDIC bytes. This class exists primarily for the use of the IFSText classes, but other components are free to use it as well.


Fields inherited from class java.io.Reader
lock
 
Constructor Summary
ConvTableReader(java.io.InputStream in)
           
ConvTableReader(java.io.InputStream in, int ccsid)
           
ConvTableReader(java.io.InputStream in, int ccsid, int bidiStringType)
           
ConvTableReader(java.io.InputStream in, java.lang.String enc)
           
 
Method Summary
 boolean markSupported()
           
 int read()
           
 int read(char[] cbuf)
           
 int read(char[] cbuf, int off, int len)
           
 java.lang.String read(int length)
          Reads up to length characters out of the underlying stream.
 
Methods inherited from class java.io.InputStreamReader
close, getEncoding, ready
 
Methods inherited from class java.io.Reader
mark, reset, skip
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConvTableReader

public ConvTableReader(java.io.InputStream in)

ConvTableReader

public ConvTableReader(java.io.InputStream in,
                       java.lang.String enc)
                throws java.io.UnsupportedEncodingException

ConvTableReader

public ConvTableReader(java.io.InputStream in,
                       int ccsid)
                throws java.io.UnsupportedEncodingException

ConvTableReader

public ConvTableReader(java.io.InputStream in,
                       int ccsid,
                       int bidiStringType)
                throws java.io.UnsupportedEncodingException
Method Detail

markSupported

public boolean markSupported()
Overrides:
markSupported in class java.io.Reader

read

public int read()
         throws java.io.IOException
Overrides:
read in class java.io.InputStreamReader

read

public int read(char[] cbuf)
         throws java.io.IOException
Overrides:
read in class java.io.Reader

read

public int read(char[] cbuf,
                int off,
                int len)
         throws java.io.IOException
Overrides:
read in class java.io.InputStreamReader

read

public java.lang.String read(int length)
                      throws java.io.IOException
Reads up to length characters out of the underlying stream.
Parameters:
length - The number of Unicode characters to return as a String. The number of bytes read from the underlying InputStream can be greater than length.
Returns:
A String of up to length Unicode characters, or null if the end of the stream has been reached. The actual number of characters returned may be less than the specified length if the end of the underlying InputStream is reached while reading.