public class ConvTableReader
extends java.io.InputStreamReader
ConvTableWriter
,
ReaderInputStream
Constructor and Description |
---|
ConvTableReader(java.io.InputStream in)
Creates a ConvTableReader that uses the default character encoding.
|
ConvTableReader(java.io.InputStream in,
int ccsid)
Creates a ConvTableReader that uses the specified CCSID.
|
ConvTableReader(java.io.InputStream in,
int ccsid,
BidiConversionProperties properties)
Creates a ConvTableReader that uses the specified CCSID and bi-directional string type.
|
ConvTableReader(java.io.InputStream in,
int ccsid,
boolean isXML)
Creates a ConvTableReader that uses the specified CCSID.
|
ConvTableReader(java.io.InputStream in,
int ccsid,
int bidiStringType)
Creates a ConvTableReader that uses the specified CCSID and bi-directional string type.
|
ConvTableReader(java.io.InputStream in,
int ccsid,
int bidiStringType,
boolean isXML)
Creates a ConvTableReader that uses the specified CCSID and bi-directional string type.
|
ConvTableReader(java.io.InputStream in,
int ccsid,
int bidiStringType,
int cacheSize)
Creates a ConvTableReader that uses the specified CCSID, bi-directional string type, and internal cache size.
|
ConvTableReader(java.io.InputStream in,
java.lang.String encoding)
Creates a ConvTableReader that uses the specified character encoding.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes this ConvTableReader and its underlying input stream.
|
int |
getByteCacheSize()
Returns the maximum number of bytes that may be stored in the internal buffer.
|
int |
getCacheSize()
Returns the maximum number of characters that may be stored in the internal buffer.
|
int |
getCcsid()
Returns the CCSID used by this ConvTableReader.
|
java.lang.String |
getEncoding()
Returns the encoding used by this ConvTableReader.
|
boolean |
markSupported()
ConvTableReader does not support the mark() operation.
|
int |
read()
Reads a single character.
|
int |
read(char[] buffer)
Reads characters into the specified array.
|
int |
read(char[] buffer,
int offset,
int length)
Reads characters into a portion of the specified array.
|
java.lang.String |
read(int length)
Reads up to length characters out of the underlying stream.
|
boolean |
ready()
Tells whether this ConvTableReader is ready to be read.
|
long |
skip(long length)
Skips the specified number of characters in the underlying stream.
|
public ConvTableReader(java.io.InputStream in) throws java.io.UnsupportedEncodingException
in
- The InputStream from which to read characters.java.io.UnsupportedEncodingException
- If the default character encoding or its associated CCSID is not supported.public ConvTableReader(java.io.InputStream in, java.lang.String encoding) throws java.io.UnsupportedEncodingException
in
- The InputStream from which to read characters.encoding
- The name of a supported character encoding.java.io.UnsupportedEncodingException
- If the specified character encoding or its associated CCSID is not supported.public ConvTableReader(java.io.InputStream in, int ccsid) throws java.io.UnsupportedEncodingException
in
- The InputStream from which to read characters.ccsid
- The CCSID.java.io.UnsupportedEncodingException
- If the specified CCSID or its corresponding character encoding is not supported.public ConvTableReader(java.io.InputStream in, int ccsid, boolean isXML) throws java.io.UnsupportedEncodingException
in
- The InputStream from which to read characters.ccsid
- The CCSID.isXML
- flag that stream is from an XML column type (needed to strip xml declaration)java.io.UnsupportedEncodingException
- If the specified CCSID or its corresponding character encoding is not supported.public ConvTableReader(java.io.InputStream in, int ccsid, int bidiStringType) throws java.io.UnsupportedEncodingException
in
- The InputStream from which to read characters.ccsid
- The CCSID.bidiStringType
- The bi-directional string type
.java.io.UnsupportedEncodingException
- If the specified CCSID or its corresponding character encoding is not supported.public ConvTableReader(java.io.InputStream in, int ccsid, int bidiStringType, boolean isXML) throws java.io.UnsupportedEncodingException
in
- The InputStream from which to read characters.ccsid
- The CCSID.bidiStringType
- The bi-directional string type
.isXML
- flag that stream is from an XML column type (needed to strip xml declaration)java.io.UnsupportedEncodingException
- If the specified CCSID or its corresponding character encoding is not supported.public ConvTableReader(java.io.InputStream in, int ccsid, BidiConversionProperties properties) throws java.io.UnsupportedEncodingException
in
- The InputStream from which to read characters.ccsid
- The CCSID.properties
- The bidi conversion properties.java.io.UnsupportedEncodingException
- If the specified CCSID or its corresponding character encoding is not supported.public ConvTableReader(java.io.InputStream in, int ccsid, int bidiStringType, int cacheSize) throws java.io.UnsupportedEncodingException
in
- The InputStream from which to read characters.ccsid
- The CCSID.bidiStringType
- The bi-directional string type
.cacheSize
- The number of characters to store in the internal buffer. The default is 1024. This number must be greater than zero.java.io.UnsupportedEncodingException
- If the specified CCSID or its corresponding character encoding is not supported.public void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in class java.io.InputStreamReader
java.io.IOException
- If an I/O exception occurs.public int getByteCacheSize()
public int getCacheSize()
getByteCacheSize()
.public int getCcsid()
public java.lang.String getEncoding()
getEncoding
in class java.io.InputStreamReader
public boolean markSupported()
markSupported
in class java.io.Reader
public int read() throws java.io.IOException
read
in class java.io.InputStreamReader
java.io.IOException
- If an I/O exception occurs.public int read(char[] buffer) throws java.io.IOException
read
in class java.io.Reader
buffer
- The destination buffer.java.io.IOException
- If an I/O exception occurs.public int read(char[] buffer, int offset, int length) throws java.io.IOException
read
in class java.io.InputStreamReader
buffer
- The destination buffer.offset
- The offset into the buffer at which to begin storing data.length
- The maximum number of characters to store. If a zero length is specified, this method does nothing and returns 0.java.io.IOException
- If an I/O exception occurs.public java.lang.String read(int length) throws java.io.IOException
length
- The maximum number of Unicode characters to return as a String. Note that the number of bytes read from the underlying InputStream could be greater than length. If a zero length is specified, this method does nothing and returns "".java.io.IOException
- If an I/O exception occurs.public boolean ready() throws java.io.IOException
ready
in class java.io.InputStreamReader
java.io.IOException
- If an I/O exception occurs.public long skip(long length) throws java.io.IOException
skip
in class java.io.Reader
length
- The number of characters to skip.java.io.IOException
- If an I/O exception occurs.