public class StreamFactory
extends java.lang.Object
RemoteStream
instance.Modifier and Type | Class and Description |
---|---|
private static class |
StreamFactory.ContextContainer
Simple container that stores and returns a context-local instance of
the global work area.
|
private static class |
StreamFactory.WorkArea
Stores global data relating to the state of the current context.
|
Modifier and Type | Field and Description |
---|---|
private static int |
NO_PAGING
Special page size which causes turning paging off.
|
private static StreamFactory.ContextContainer |
work
Stores context-local state variables.
|
Constructor and Description |
---|
StreamFactory() |
Modifier and Type | Method and Description |
---|---|
static Stream |
openClipboardStream(boolean write)
Open a new stream targeting the OS clipboard.
|
static Stream |
openClipboardStream(boolean write,
boolean paged)
Open a new stream targeting the OS clipboard.
|
static Stream |
openClipboardStream(boolean write,
int pageSz)
Open a new stream targeting the OS clipboard.
|
static Stream |
openClipboardStream(boolean write,
int pageSz,
boolean paged)
Open a new stream targeting the OS clipboard.
|
static Stream |
openDirStream(character dir)
Constructs a remote stream instance representing a stream result of
INPUT FROM OS-DIR statement.
|
static Stream |
openDirStream(character dir,
boolean noAttrList)
Constructs a remote stream instance representing a stream result of
INPUT FROM OS-DIR statement.
|
static Stream |
openDirStream(java.lang.String dir)
Constructs a remote stream instance representing a stream result of
INPUT FROM OS-DIR statement.
|
static Stream |
openDirStream(java.lang.String dir,
boolean noAttrList)
Constructs a remote stream instance representing a stream result of
INPUT FROM OS-DIR statement.
|
static Stream |
openFileStream(java.lang.String filename,
boolean write,
boolean append)
Constructs a remote stream instance representing a file using a filename, this file or
device will be opened for reading or writing based on the given
write flag. |
static Stream |
openFileStream(java.lang.String filename,
boolean write,
boolean append,
boolean paged)
Constructs a remote stream instance representing a file using a filename, this file or
device will be opened for reading or writing based on the given
write flag. |
static Stream |
openFileStream(java.lang.String filename,
boolean write,
boolean append,
int sz)
Constructs a remote stream instance representing a file using a filename, this file or
device will be opened for reading or writing based on the given
write flag. |
static Stream |
openFileStream(java.lang.String filename,
boolean write,
boolean append,
int pageSz,
boolean paged)
Constructs a remote stream instance representing a file using a filename, this file or
device will be opened for reading or writing based on the given
write flag. |
static Stream |
openPrinterStream()
Constructs a remote stream instance representing the printer Stream
result of the OUTPUT TO PRINTER statement.
|
static Stream |
openPrinterStream(java.lang.String printerName)
Constructs a remote stream instance representing the printer Stream
result of the OUTPUT TO PRINTER statement.
|
static Stream |
openProcessStream()
Constructs a remote stream instance representing a process' standard I/O.
|
static Stream |
openTerminalStream()
Constructs a remote stream instance representing the terminal.
|
static Stream |
openTerminalStream(boolean append)
Constructs a remote stream instance representing the terminal.
|
static Stream |
openTerminalStream(boolean append,
boolean paged)
Constructs a remote stream instance representing the terminal.
|
static Stream |
openTerminalStream(boolean append,
int pageSz)
Constructs a remote stream instance representing the terminal.
|
static Stream |
openTerminalStream(boolean append,
int pageSz,
boolean paged)
Constructs a remote stream instance representing the terminal.
|
static Stream |
openTerminalStream(int pageSz)
Constructs a remote stream instance representing the terminal.
|
private static final int NO_PAGING
private static StreamFactory.ContextContainer work
public static Stream openFileStream(java.lang.String filename, boolean write, boolean append, int pageSz, boolean paged) throws ErrorConditionException
write
flag.
The current read/write position will be at offset 0 unless in write
mode and
the append
flag is on (in which case the write position will be at the end of
the file).filename
- The name of the file or device to open. Must not be null
.write
- If true
, open in write mode, otherwise open the file for reading.append
- In write
mode, if true
, the current file pointer is
set to the end of the file. Otherwise if in write
mode, the file
is truncated to 0 length. This value is ignored in read
mode.pageSz
- Desired page size. -1
means default paging.paged
- true
means that stream is paged.null
if an error occurred while silent
error mode was active.ErrorConditionException
- If the file does not exist OR if the current user does not have the proper rights
to open the file or device.public static Stream openFileStream(java.lang.String filename, boolean write, boolean append, int sz)
write
flag.
The current read/write position will be at offset 0 unless in write
mode and
the append
flag is on (in which case the write position will be at the end of
the file).filename
- The name of the file or device to open. Must not be null
.write
- If true
, open in write mode, otherwise open the file for reading.append
- In write
mode, if true
, the current file pointer is
set to the end of the file. Otherwise if in write
mode, the file
is truncated to 0 length. This value is ignored in read
mode.sz
- Desired page size. -1
means default paging.null
if an error occurred while silent
error mode was active.ErrorConditionException
- If the file does not exist OR if the current user does not have the proper rights
to open the file or device.public static Stream openFileStream(java.lang.String filename, boolean write, boolean append)
write
flag.
The current read/write position will be at offset 0 unless in write
mode and
the append
flag is on (in which case the write position will be at the end of
the file).
This stream will NOT have paging active.
filename
- The name of the file or device to open. Must not be null
.write
- If true
, open in write mode, otherwise open the file for reading.append
- In write
mode, if true
, the current file pointer is
set to the end of the file. Otherwise if in write
mode, the file
is truncated to 0 length. This value is ignored in read
mode.null
if an error occurred while silent
error mode was active.ErrorConditionException
- If the file does not exist OR if the current user does not have the proper rights
to open the file or device.public static Stream openFileStream(java.lang.String filename, boolean write, boolean append, boolean paged)
write
flag.
The current read/write position will be at offset 0 unless in write
mode and
the append
flag is on (in which case the write position will be at the end of
the file).filename
- The name of the file or device to open. Must not be null
.write
- If true
, open in write mode, otherwise open the file for reading.append
- In write
mode, if true
, the current file pointer is
set to the end of the file. Otherwise if in write
mode, the file
is truncated to 0 length. This value is ignored in read
mode.paged
- true
means that stream is paged with the default page size.null
if an error occurred while silent
error mode was active.ErrorConditionException
- If the file does not exist OR if the current user does not have the proper rights
to open the file or device.public static Stream openDirStream(java.lang.String dir, boolean noAttrList)
dir
- The String
variable representing the directory for
which OS-DIR is applied.noAttrList
- This indicates if type index will no be output to stream If
true
the index will not be output to the stream,
if false
it will be output.Stream
wrapping the OsDirStream
containing the result of OS-DIR implementation, or null if
an error has occurred.public static Stream openDirStream(java.lang.String dir)
When no boolean variable representing the noAttrList which decides if file type will be added to the stream is present the file type will be added by default.
dir
- The String
variable representing the directory for
which OS-DIR is applied.Stream
wrapping the OsDirStream
containing the result of OS-DIR implementation, or null if
an error has occurred.public static Stream openDirStream(character dir, boolean noAttrList)
dir
- The character
variable representing the directory
for which OS-DIR is applied.noAttrList
- This indicates if type index will no be output to stream If
true
the index will not be output to the stream,
if false
it will be output.Stream
wrapping the OsDirStream
containing the result of OS-DIR implementation, or null if
an error has occurred.public static Stream openDirStream(character dir)
When no boolean variable representing the noAttrList which decides if file type will be added to the stream is present the file type will be added by default.
dir
- The character
variable representing the directory
for which OS-DIR is applied.Stream
wrapping the OsDirStream
containing the result of OS-DIR implementation, or null if
an error has occurred.public static Stream openProcessStream()
public static Stream openClipboardStream(boolean write)
write
- If true
, open in write mode, otherwise open the file for reading.public static Stream openClipboardStream(boolean write, boolean paged)
write
- If true
, open in write mode, otherwise open the file for reading.paged
- true
if the stream is paged.public static Stream openClipboardStream(boolean write, int pageSz)
write
- If true
, open in write mode, otherwise open the file for reading.pageSz
- Desired page size. -1
means default paging.public static Stream openClipboardStream(boolean write, int pageSz, boolean paged)
write
- If true
, open in write mode, otherwise open the file for reading.pageSz
- Desired page size. -1
means default paging.paged
- true
if the stream is paged.public static Stream openTerminalStream()
public static Stream openTerminalStream(int pageSz)
pageSz
- Desired page size. -1
means default paging.public static Stream openTerminalStream(boolean append)
append
- In write
mode, if true
, the current file pointer is
set to the end of the file. Otherwise if in write
mode, the file
is truncated to 0 length. This value is ignored in read
mode.public static Stream openTerminalStream(boolean append, boolean paged)
append
- In write
mode, if true
, the current file pointer is
set to the end of the file. Otherwise if in write
mode, the file
is truncated to 0 length. This value is ignored in read
mode.paged
- true
if the stream is paged.public static Stream openTerminalStream(boolean append, int pageSz)
append
- In write
mode, if true
, the current file pointer is
set to the end of the file. Otherwise if in write
mode, the file
is truncated to 0 length. This value is ignored in read
mode.pageSz
- Desired page size. -1
means default paging.public static Stream openTerminalStream(boolean append, int pageSz, boolean paged)
append
- In write
mode, if true
, the current file pointer is
set to the end of the file. Otherwise if in write
mode, the file
is truncated to 0 length. This value is ignored in read
mode.pageSz
- Desired page size. -1
means default paging.paged
- true
means that stream is paged.public static Stream openPrinterStream()
public static Stream openPrinterStream(java.lang.String printerName)
printerName
- name of target printer