|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.io.InputStream | +--com.ibm.as400.access.PrintObjectPageInputStream
The PrintObjectPageInputStream class is used to read data out of an AS/400 spooled file one page at a time. The page of data may be transformed, depending on the PrintParameterList used to create an instance of the class.
The number of pages in the spooled file may be estimated. To help process spooled files with estimated page counts, methods nextPage, previousPage, and selectPage will return false if the requested page is not available.
An instance of this class is created using the getPageInputStream method from the class SpooledFile.
NOTE: This class is supported on OS/400 V4R4 or later. Not all spooled file formats are supported for transform.
Method Summary | |
int |
available()
Returns the number of bytes remaining in the current page. |
void |
close()
Closes the input stream and releases any resources associated with it. |
int |
getCurrentPageNumber()
Returns the number of the current page of the input stream. |
int |
getNumberOfPages()
Returns the number of pages in the stream. |
boolean |
isPagesEstimated()
Indicates if the number of pages is estimated. |
void |
mark(int readLimit)
Marks the current position of the current page of the input stream. |
boolean |
markSupported()
Returns a boolean indicating whether this stream type supports mark and reset. |
boolean |
nextPage()
Repositions the stream to the next page. |
boolean |
previousPage()
Repositions the stream to the previous page. |
int |
read()
Reads the next byte of data from this input stream. |
int |
read(byte[] data)
Reads up to data.length bytes of data from the page input stream into data. |
int |
read(byte[] data,
int dataOffset,
int length)
Reads up to length bytes of data from this input stream into data, starting at the array offset dataOffset. |
void |
reset()
Repositions the stream to the last marked position. |
boolean |
selectPage(int page)
Repositions the stream to page page. |
long |
skip(long bytesToSkip)
Skips over the next bytesToSkip bytes in the stream. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Method Detail |
public int available() throws java.io.IOException
public void close() throws java.io.IOException
public int getCurrentPageNumber()
public int getNumberOfPages()
public boolean isPagesEstimated()
public void mark(int readLimit)
readLimit
- The maximum limit of bytes allowed to be read before
the mark position is no longer valid.public boolean markSupported()
public boolean nextPage() throws java.io.IOException
public boolean previousPage() throws java.io.IOException
public int read() throws java.io.IOException
public int read(byte[] data) throws java.io.IOException
data
- The buffer into which the data is read.public int read(byte[] data, int dataOffset, int length) throws java.io.IOException
data
- The buffer into which the data is read.dataOffset
- The start offset of the data.length
- The maximum number of bytes to read.public void reset() throws java.io.IOException
public boolean selectPage(int page) throws java.io.IOException, java.lang.IllegalArgumentException
page
- The page at which to reposition the input stream.public long skip(long bytesToSkip) throws java.io.IOException
bytesToSkip
- The number of bytes to be skipped.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |