All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.ibm.as400.access.SCS5256Writer

java.lang.Object
   |
   +----java.io.Writer
           |
           +----java.io.OutputStreamWriter
                   |
                   +----com.ibm.as400.access.SCS5256Writer

public class SCS5256Writer
extends OutputStreamWriter
The SCS5256Writer class writes an SCS 5256 data stream to an output stream, translating characters into bytes of the specified CCSID. SCS5256Writer is the simplest SCS generator. It supports text, carriage return, line feed, new line, form feed, Absolute Horiz/Vert positioning, Relative Horiz/Vert positioning, and Set Vertical Format.

See Also:
OutputStreamWriter

Constructor Index

 o SCS5256Writer(OutputStream)
Constructs a SCS5256Writer. Deprecated.
 o SCS5256Writer(OutputStream, int)
Constructs a SCS5256Writer. Deprecated.
 o SCS5256Writer(OutputStream, int, AS400)
Constructs a SCS5256Writer.
 o SCS5256Writer(OutputStream, String)
Constructs a SCS5256Writer. Deprecated.

Method Index

 o absoluteHorizontalPosition(int)
Moves the print position to the column specified.
 o absoluteVerticalPosition(int)
Moves the print position to the line number specified.
 o carriageReturn()
Adds a carriage return control to the stream.
 o close()
Closes the stream.
 o endPage()
Ends current page.
 o flush()
Flushes the stream.
 o getEncoding()
Returns the name of the encoding being used by this stream.
 o lineFeed()
Adds a line feed control to the stream.
 o newLine()
Adds a new line control to the stream.
 o relativeHorizontalPosition(int)
Moves the print position the number of characters specified.
 o relativeVerticalPosition(int)
Moves the print position the number of lines specified.
 o setVerticalFormat(int)
Sets the Vertical Format.
 o write(char[], int, int)
Writes a portion of an array of characters.
 o write(int)
Writes a single character.
 o write(String)
Writes a string.
 o write(String, int, int)
Writes a portion of a string.

Constructors

 o SCS5256Writer
 public SCS5256Writer(OutputStream out)
Note: SCS5256Writer() is deprecated. Replaced by SCS5256Writer(OutputStream, int, AS400). Any SCS5256Writer object that is created without specifying an AS400 system object on its constructor may not behave as expected in certain environments.

Constructs a SCS5256Writer. The default encoding will be used.

Parameters:
out - An OutputStream.
 o SCS5256Writer
 public SCS5256Writer(OutputStream out,
                      int ccsid) throws UnsupportedEncodingException
Note: SCS5256Writer() is deprecated. Replaced by SCS5256Writer(OutputStream, int, AS400). Any SCS5256Writer object that is created without specifying an AS400 system object on its constructor may not behave as expected in certain environments.

Constructs a SCS5256Writer.

Parameters:
out - An OutputStream.
ccsid - The name of the target CCSID to be used.
Throws: UnsupportedEncodingException
If ccsid is invalid.
 o SCS5256Writer
 public SCS5256Writer(OutputStream out,
                      int ccsid,
                      AS400 system) throws UnsupportedEncodingException
Constructs a SCS5256Writer.

Parameters:
out - An OutputStream.
ccsid - The name of the target CCSID to be used.
system - The system.
Throws: UnsupportedEncodingException
If ccsid is invalid.
 o SCS5256Writer
 public SCS5256Writer(OutputStream out,
                      String encoding) throws UnsupportedEncodingException
Note: SCS5256Writer() is deprecated. Replaced by SCS5256Writer(OutputStream, int, AS400). Any SCS5256Writer object that is created without specifying an AS400 system object on its constructor may not behave as expected in certain environments.

Constructs a SCS5256Writer.

Parameters:
out - An OutputStream.
encoding - The name of the target encoding to be used.
Throws: UnsupportedEncodingException
If encoding is invalid.

Methods

 o absoluteHorizontalPosition
 public void absoluteHorizontalPosition(int column) throws IOException
Moves the print position to the column specified. Moving beyond the right end of the page will cause an error on the printer.

Parameters:
column - The new horizontal print position. Valid values are 0 to the maximum print position as set in the SetHorizontalFormat method. A value of 0 causes a no-op. The number of columns on a line is dependent on the current character width (CPI) and the width of the page.
Throws: IOException
If an error occurs while communicating with the AS/400.
 o absoluteVerticalPosition
 public void absoluteVerticalPosition(int line) throws IOException
Moves the print position to the line number specified. Moving above the current line causes a form feed and move to the specified line on the next page.

Parameters:
line - The new vertical print position. Valid values are 0 to the current forms length as specified by the SetVerticalFormat method. A value of 0 causes a no-op. If the value is less than the current line, the forms are moved to the specified line of the next logical page.
Throws: IOException
If an error occurs while communicating with the AS/400.
 o carriageReturn
 public void carriageReturn() throws IOException
Adds a carriage return control to the stream.

Throws: IOException
If an error occurs while communicating with the AS/400.
 o close
 public void close() throws IOException
Closes the stream.

Throws: IOException
If an error occurs while communicating with the AS/400.
Overrides:
close in class OutputStreamWriter
 o endPage
 public void endPage() throws IOException
Ends current page.

Throws: IOException
If an error occurs while communicating with the AS/400.
 o flush
 public void flush() throws IOException
Flushes the stream.

Throws: IOException
If an error occurs while communicating with the AS/400.
Overrides:
flush in class OutputStreamWriter
 o getEncoding
 public String getEncoding()
Returns the name of the encoding being used by this stream. It may return null if the stream has been closed.

Overrides:
getEncoding in class OutputStreamWriter
 o lineFeed
 public void lineFeed() throws IOException
Adds a line feed control to the stream.

Throws: IOException
If an error occurs while communicating with the AS/400.
 o newLine
 public void newLine() throws IOException
Adds a new line control to the stream.

Throws: IOException
If an error occurs while communicating with the AS/400.
 o relativeHorizontalPosition
 public void relativeHorizontalPosition(int chars) throws IOException
Moves the print position the number of characters specified. Moving beyond the right end of the page will cause an error on the printer.

Parameters:
chars - The number of character widths to move. Valid values are 0 to the maximum print position minus the current column. The maximum print position is the current CPI * 13.2 inches. A value of 0 causes a no-op.
Throws: IOException
If an error occurs while communicating with the AS/400.
 o relativeVerticalPosition
 public void relativeVerticalPosition(int lines) throws IOException
Moves the print position the number of lines specified.

Parameters:
lines - The number of lines to move down the page. Valid values are 0 to the last logical line on the page. A value of 0 causes a no-op.
Throws: IOException
If an error occurs while communicating with the AS/400.
 o setVerticalFormat
 public void setVerticalFormat(int NumOfLines) throws IOException
Sets the Vertical Format. This specifies the maximum number of lines on the page. Note that when the printer executes this command the current line number on the printer is set to 1. Also, the combination of LPI and Vertical Format should not exceed 159 cm (63.75 inches). Changing the Line Density changes where the maximum line is on the physical page.

Parameters:
NumOfLines - The maximum number of lines. Valid values are 0 to 255. A value of 0 causes vertical format to be set to the printer default.
Throws: IOException
If an error occurs while communicating with the AS/400.
 o write
 public void write(char databuffer[],
                   int offset,
                   int length) throws IOException
Writes a portion of an array of characters.

Parameters:
databuffer - The buffer of characters.
offset - The offset from which to start writing characters.
length - The number of characters to write.
Throws: IOException
If an error occurs while communicating with the AS/400.
Overrides:
write in class OutputStreamWriter
 o write
 public void write(int c) throws IOException
Writes a single character.

Parameters:
c - The character to write.
Throws: IOException
If an error occurs while communicating with the AS/400.
Overrides:
write in class OutputStreamWriter
 o write
 public void write(String str) throws IOException
Writes a string.

Parameters:
str - The string to write.
Throws: IOException
If an error occurs while communicating with the AS/400.
Overrides:
write in class Writer
 o write
 public void write(String str,
                   int offset,
                   int length) throws IOException
Writes a portion of a string.

Parameters:
str - The string to write.
offset - The offset from which to start writing characters.
length - The number of characters to write.
Throws: IOException
If an error occurs while communicating with the AS/400.
Overrides:
write in class OutputStreamWriter

All Packages  Class Hierarchy  This Package  Previous  Next  Index