com.ibm.as400.access
Class AS400JDBCInputStream

java.lang.Object
  |
  +--java.io.InputStream
        |
        +--com.ibm.as400.access.AS400JDBCInputStream

public class AS400JDBCInputStream
extends java.io.InputStream

The AS400JDBCInputStream class provides access to binary data using an input stream. The data is valid only within the current transaction.


Method Summary
 int available()
          Returns the number of bytes that can be read without blocking.
 void close()
          Closes the stream and releases any associated system resources.
 void mark(int readLimit)
          Marks the current position in the stream.
 boolean markSupported()
          Indicates if mark() and reset() are supported.
 int read()
          Reads the next byte of data.
 int read(byte[] data)
          Reads bytes of data.
 int read(byte[] data, int start, int length)
          Reads bytes of data.
 void reset()
          Repositions to the marked position.
 long skip(long length)
          Skips over and discards data.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

available

public int available()
              throws java.io.IOException
Returns the number of bytes that can be read without blocking.
Overrides:
available in class java.io.InputStream
Returns:
The number of bytes that can be read without blocking.
Throws:
java.io.IOException - If an input/output error occurs.

close

public void close()
           throws java.io.IOException
Closes the stream and releases any associated system resources.
Overrides:
close in class java.io.InputStream
Throws:
java.io.IOException - If an input/output error occurs.

mark

public void mark(int readLimit)
Marks the current position in the stream. This is not supported.
Overrides:
mark in class java.io.InputStream
Parameters:
readLimit - The read limit.

markSupported

public boolean markSupported()
Indicates if mark() and reset() are supported.
Overrides:
markSupported in class java.io.InputStream
Returns:
Always false. mark() and reset() are not supported.

read

public int read()
         throws java.io.IOException
Reads the next byte of data. This method blocks until data is available, the end of the stream is detected, or an exception is thrown.
Overrides:
read in class java.io.InputStream
Returns:
The next byte of data as an int in the range 0 to 255, or -1 if no more data is available.
Throws:
java.io.IOException - If an input/output error occurs.

read

public int read(byte[] data)
         throws java.io.IOException
Reads bytes of data. This method blocks until data is available, the end of the stream is detected, or an exception is thrown.
Overrides:
read in class java.io.InputStream
Parameters:
data - The byte array to fill with data. This method will read as much data as possible to fill the array.
Returns:
The number of bytes of data read, or -1 if no more data is available.
Throws:
java.io.IOException - If an input/output error occurs.

read

public int read(byte[] data,
                int start,
                int length)
         throws java.io.IOException
Reads bytes of data. This method blocks until data is available, the end of the stream is detected, or an exception is thrown.
Overrides:
read in class java.io.InputStream
Parameters:
data - The byte array to fill with data. This method will read as much data as possible to fill the array.
start - The start position in the array.
length - The maximum number of bytes to read.
Returns:
The number of bytes of data read, or -1 if no more data is available.
Throws:
java.io.IOException - If an input/output error occurs.

reset

public void reset()
           throws java.io.IOException
Repositions to the marked position. This is not supported.
Overrides:
reset in class java.io.InputStream
Throws:
java.io.IOException - If an input/output error occurs.

skip

public long skip(long length)
          throws java.io.IOException
Skips over and discards data.
Overrides:
skip in class java.io.InputStream
Parameters:
length - The maximum number of bytes to skip. If negative, no bytes are skipped.
Returns:
The number of bytes skipped.
Throws:
java.io.IOException - If an input/output error occurs.