Generating an SCS data streamTo generate spooled files that will print on certain printers attached to AS/400, an SNA Character Stream (SCS) data stream may have to be created. (SCS is a text-based, EBCDIC data stream that can be printed on SCS printers, IPDS printers, or to PC printers.) SCS can be printed by converting it using an emulator or the host print transform on the AS/400. You can use the SCS writer classes to generate such an SCS data stream. The SCS writer classes convert Java unicode characters and formatting options into an SCS data stream. Five SCS writer classes generate varying levels of SCS data streams. The caller should choose the writer that matches the final printer destination to which the caller or end user will be printing. Use the following SCS writer classes to generate an SCS printer data stream:
To construct an SCS writer, the caller needs an output stream and, optionally, an encoding. The data stream is written to the output stream. To create an SCS spooled file, the caller first constructs a SpooledFileOutputStream, and then uses that to construct an SCS writer object. The encoding parameter gives a target EBCDIC coded character set identifier (CCSID) to convert the characters to. Once the writer is constructed, use the write() methods to output text. Use the carriageReturn(), lineFeed(), and newLine() methods to position the write cursor on the page. Use the endPage() method to end the current page and start a new page. When all of the data has been written, use the close() method to end the data stream and close the output stream.
[ Legal | AS/400 Glossary ] |