All Packages Class Hierarchy This Package Previous Next Index
Class com.ibm.as400.access.PrintObjectInputStream
java.lang.Object
|
+----java.io.InputStream
|
+----com.ibm.as400.access.PrintObjectInputStream
- public class PrintObjectInputStream
- extends InputStream
The PrintObjectInputStream class is used to read data out of an
AS/400 spooled file or AFP resource such as an overlay or page
segment.
-
available()
- Returns the number of bytes that can be read without blocking.
-
close()
- Closes the input stream.
-
finalize()
- Closes the stream when garbage is collected.
-
mark(int)
- Marks the current position in the input stream.
-
markSupported()
- Returns a boolean indicating whether this stream type
supports mark/reset.
-
read()
- Reads the next byte of data from this input stream.
-
read(byte[])
- Reads up to data.length bytes of data from this
input stream into data.
-
read(byte[], int, int)
- Reads up to length bytes of data from this input stream
into data, starting at the array offset dataOffset.
-
reset()
- Repositions the stream to the last marked position.
-
skip(long)
- Skips over the next bytesToSkip bytes in the stream.
available
public int available() throws IOException
- Returns the number of bytes that can be read without blocking.
This class always returns the number of bytes remaining in the spooled
file or AFP resource.
- Returns:
- The number of available bytes without blocking.
- Overrides:
- available in class InputStream
close
public void close() throws IOException
- Closes the input stream.
It must be called to release any resources associated with the stream.
- Throws: IOException
- If an error occurs while communicating with the AS/400.
- Overrides:
- close in class InputStream
finalize
protected void finalize() throws Throwable
- Closes the stream when garbage is collected.
- Throws: Throwable
- If an error occurs.
- Overrides:
- finalize in class Object
mark
public synchronized void mark(int readLimit)
- Marks the current position in the input stream.
A subsequent call to reset() will reposition the stream at the
last marked position, so that subsequent reads will reread the same bytes.
The stream promises to allow readLimit bytes to be read before the
mark position gets invalidated.
- Parameters:
- readLimit - The maximum limit of bytes allowed
to be read before the mark position becomes invalid.
- Overrides:
- mark in class InputStream
markSupported
public boolean markSupported()
- Returns a boolean indicating whether this stream type
supports mark/reset.
- Returns:
- Always true. Objects of this class will support
the mark/reset methods.
- Overrides:
- markSupported in class InputStream
read
public int read() throws IOException
- Reads the next byte of data from this input stream.
- Returns:
- The byte read, or -1 if the end of the stream is reached.
- Throws: IOException
- If an error occurs while communicating with the AS/400.
- Overrides:
- read in class InputStream
read
public int read(byte data[]) throws IOException
- Reads up to data.length bytes of data from this
input stream into data.
- Parameters:
- data - The buffer into which the data is read.
- Returns:
- The total number of bytes read into the buffer,
or -1 if there is no more data because the
end of file has been reached.
- Throws: IOException
- If an error occurs while communicating with the AS/400.
- Overrides:
- read in class InputStream
read
public int read(byte data[],
int dataOffset,
int length) throws IOException
- Reads up to length bytes of data from this input stream
into data, starting at the array offset dataOffset.
- Parameters:
- data - The buffer into which the data is read.
- dataOffset - The start offset of the data.
- length - The maximum number of bytes to read.
- Returns:
- The total number of bytes read into the buffer,
or -1 if there is no more data because the
end of file has been reached.
- Throws: IOException
- If an error occurs while communicating with the AS/400.
- Overrides:
- read in class InputStream
reset
public synchronized void reset() throws IOException
- Repositions the stream to the last marked position.
If the stream has not been marked or if the mark has been invalidated,
an IOException is thrown.
- Throws: IOException
- If an error occurs while communicating with the AS/400.
- Overrides:
- reset in class InputStream
skip
public long skip(long bytesToSkip) throws IOException
- Skips over the next bytesToSkip bytes in the stream.
This method may skip less bytes than specified if the end of
file is reached. The actual number of bytes skipped is returned.
- Parameters:
- bytesToSkip - The number of bytes to be skipped.
- Returns:
- The actual number of bytes skipped.
- Throws: IOException
- If an error occurs while communicating with the AS/400.
- Overrides:
- skip in class InputStream
All Packages Class Hierarchy This Package Previous Next Index