All Packages Class Hierarchy This Package Previous Next Index
Class com.ibm.as400.access.IFSTextFileOutputStream
java.lang.Object
|
+----java.io.OutputStream
|
+----com.ibm.as400.access.IFSFileOutputStream
|
+----com.ibm.as400.access.IFSTextFileOutputStream
- public class IFSTextFileOutputStream
- extends IFSFileOutputStream
- implements Serializable
The IFSTextFileOutputStream class represents an integrated file system output stream for character data.
IFSTextFileOutputStream object is capable of generating file events which call the following FileListener methods: fileClosed, fileModified, and fileOpened.
The following example illustrates the use of IFSTextFileOutputStream:
// Work with /File on the system eniac.
AS400 as400 = new AS400("eniac");
IFSTextFileOutputStream file = new IFSTextFileOutputStream(as400, "/File");
// Write a String to the file (don't convert characters).
file.write("Hello world");
// Close the file.
file.close();
- See Also:
- FileEvent, addFileListener, removeFileListener
-
IFSTextFileOutputStream()
- Constructs an IFSTextFileOutputStream object.
-
IFSTextFileOutputStream(AS400, IFSFile, int, boolean)
- Constructs an IFSTextFileOutputStream object.
-
IFSTextFileOutputStream(AS400, IFSFile, int, boolean, int)
- Constructs an IFSTextFileOutputStream object.
-
IFSTextFileOutputStream(AS400, IFSJavaFile, int, boolean)
- Constructs an IFSTextFileOutputStream object.
-
IFSTextFileOutputStream(AS400, IFSJavaFile, int, boolean, int)
- Constructs an IFSTextFileOutputStream object.
-
IFSTextFileOutputStream(AS400, String)
- Constructs an IFSTextFileOutputStream object.
-
IFSTextFileOutputStream(AS400, String, int)
- Constructs an IFSTextFileOutputStream object.
-
IFSTextFileOutputStream(AS400, String, int, boolean)
- Constructs an IFSTextFileOutputStream object.
-
IFSTextFileOutputStream(AS400, String, int, boolean, int)
- Constructs an IFSTextFileOutputStream object.
-
IFSTextFileOutputStream(IFSFileDescriptor)
- Constructs an IFSTextFileOutputStream object.
-
getCCSID()
- Returns the CCSID.
-
setCCSID(int)
- Sets the CCSID for the data written to the file.
-
write(String)
- Writes characters to this text file input stream.
IFSTextFileOutputStream
public IFSTextFileOutputStream()
- Constructs an IFSTextFileOutputStream object.
IFSTextFileOutputStream
public IFSTextFileOutputStream(AS400 system,
String name) throws AS400SecurityException, IOException
- Constructs an IFSTextFileOutputStream object.
It creates a file output stream to write to the text file with the specified name.
Other readers and writers are allowed to access the file. The file is
replaced if it exists; otherwise the file is created.
By default, Unicode data is written to the file.
- Parameters:
- system - The AS400 that contains the file.
- name - The file to be opened for writing.
- Throws: AS400SecurityException
- If a security or authority error occurs.
- Throws: IOException
- If an error occurs while communicating with the AS/400.
IFSTextFileOutputStream
public IFSTextFileOutputStream(AS400 system,
String name,
int ccsid) throws AS400SecurityException, IOException
- Constructs an IFSTextFileOutputStream object.
It creates a file output stream to write to the text file with the specified name and CCSID.
Other readers and writers are allowed to access the file. The file is
replaced if it exists; otherwise the file is created.
- Parameters:
- system - The AS400 that contains the file.
- name - The file to be opened for writing.
- ccsid - The CCSID of the data being written to the file.
- Throws: AS400SecurityException
- If a security or authority error occurs.
- Throws: IOException
- If an error occurs while communicating with the AS/400.
IFSTextFileOutputStream
public IFSTextFileOutputStream(AS400 system,
String name,
int shareOption,
boolean append) throws AS400SecurityException, IOException
- Constructs an IFSTextFileOutputStream object.
It creates a file output stream to write to the text file with the specified name.
By default, Unicode data is written to the file.
- Parameters:
- system - The AS400 that contains the file.
- name - The file to be opened for writing.
- shareOption - Indicates how other user's can access the file.
- SHARE_ALL Share access with readers and writers
- SHARE_NONE Share access with none
- SHARE_READERS Share access with readers
- SHARE_WRITERS Share access with writers
- append - Controls the behavior when the file exists. If true, output
is appended to the file;
otherwise, the current contents of the file are erased,
and output replaces the file contents.
- Throws: AS400SecurityException
- If a security or authority error occurs.
- Throws: IOException
- If an error occurs while communicating with the AS/400.
IFSTextFileOutputStream
public IFSTextFileOutputStream(AS400 system,
String name,
int shareOption,
boolean append,
int ccsid) throws AS400SecurityException, IOException
- Constructs an IFSTextFileOutputStream object.
It creates a file output stream to write to the text file with the specified name and CCSID.
- Parameters:
- system - The AS400 that contains the file.
- name - The file to be opened for writing.
- shareOption - Indicates how other user's can access the file.
- SHARE_ALL Share access with readers and writers
- SHARE_NONE Share access with none
- SHARE_READERS Share access with readers
- SHARE_WRITERS Share access with writers
- append - Controls the behavior when the file exists. If true, output
is appended to the file;
otherwise, the current contents of the file are erased,
and output replaces the file contents.
- ccsid - The CCSID of the data being written to the file.
- Throws: AS400SecurityException
- If a security or authority error occurs.
- Throws: IOException
- If an error occurs while communicating with the AS/400.
IFSTextFileOutputStream
public IFSTextFileOutputStream(AS400 system,
IFSFile file,
int shareOption,
boolean append) throws AS400SecurityException, IOException
- Constructs an IFSTextFileOutputStream object.
It creates a file output stream to write to the text file specified by file.
By default, Unicode data is written to the file.
- Parameters:
- system - The AS400 that contains the file.
- file - The file to be opened for writing.
- shareOption - Indicates how other user's can access the file.
- SHARE_ALL Share access with readers and writers
- SHARE_NONE Share access with none
- SHARE_READERS Share access with readers
- SHARE_WRITERS Share access with writers
- append - Controls the behavior when the file exists. If true, output
is appended to the file;
otherwise, the current contents of the file are erased,
and output replaces the file contents.
- Throws: AS400SecurityException
- If a security or authority error occurs.
- Throws: IOException
- If an error occurs while communicating with the AS/400.
IFSTextFileOutputStream
public IFSTextFileOutputStream(AS400 system,
IFSFile file,
int shareOption,
boolean append,
int ccsid) throws AS400SecurityException, IOException
- Constructs an IFSTextFileOutputStream object.
It creates a file output stream to write to the text file specified by file using the
CCSID specified by ccsid.
- Parameters:
- system - The AS400 that contains the file.
- file - The file to be opened for writing.
- shareOption - Indicates how other user's can access the file.
- SHARE_ALL Share access with readers and writers
- SHARE_NONE Share access with none
- SHARE_READERS Share access with readers
- SHARE_WRITERS Share access with writers
- append - Controls the behavior when the file exists. If true, output
is appended to the file;
otherwise, the current contents of the file are erased,
and output replaces the file contents.
- ccsid - The CCSID of the data being written to the file.
- Throws: AS400SecurityException
- If a security or authority error occurs.
- Throws: IOException
- If an error occurs while communicating with the AS/400.
IFSTextFileOutputStream
public IFSTextFileOutputStream(AS400 system,
IFSJavaFile file,
int shareOption,
boolean append) throws AS400SecurityException, IOException
- Constructs an IFSTextFileOutputStream object.
It creates a file output stream to write to the text file specified by file.
- Parameters:
- system - The AS400 that contains the file.
- file - The file to be opened for writing.
- shareOption - Indicates how other user's can access the file.
- SHARE_ALL Share access with readers and writers
- SHARE_NONE Share access with none
- SHARE_READERS Share access with readers
- SHARE_WRITERS Share access with writers
- append - Controls the behavior when the file exists. If true, output
is appended to the file;
otherwise, the current contents of the file are erased,
and output replaces the file contents.
- Throws: AS400SecurityException
- If a security or authority error occurs.
- Throws: IOException
- If an error occurs while communicating with the AS/400.
IFSTextFileOutputStream
public IFSTextFileOutputStream(AS400 system,
IFSJavaFile file,
int shareOption,
boolean append,
int ccsid) throws AS400SecurityException, IOException
- Constructs an IFSTextFileOutputStream object.
It creates a file output stream to write to the text file specified by file using the
CCSID specified by ccsid.
- Parameters:
- system - The AS400 that contains the file.
- file - The file to be opened for writing.
- shareOption - Indicates how other user's can access the file.
- SHARE_ALL Share access with readers and writers
- SHARE_NONE Share access with none
- SHARE_READERS Share access with readers
- SHARE_WRITERS Share access with writers
- append - Controls the behavior when the file exists. If true, output
is appended to the file;
otherwise, the current contents of the file are erased,
and output replaces the file contents.
- ccsid - The CCSID of the data being written to the file.
- Throws: AS400SecurityException
- If a security or authority error occurs.
- Throws: IOException
- If an error occurs while communicating with the AS/400.
IFSTextFileOutputStream
public IFSTextFileOutputStream(IFSFileDescriptor fd)
- Constructs an IFSTextFileOutputStream object.
It creates a file output stream to write to file descriptor fd.
- Parameters:
- fd - The file descriptor to be opened for writing.
getCCSID
public int getCCSID()
- Returns the CCSID.
- Returns:
- The CCSID.
- Overrides:
- getCCSID in class IFSFileOutputStream
setCCSID
public void setCCSID(int ccsid) throws PropertyVetoException
- Sets the CCSID for the data written to the file.
- Parameters:
- ccsid - The target CCSID.
- Throws: PropertyVetoException
- If the change is vetoed.
- Overrides:
- setCCSID in class IFSFileOutputStream
write
public void write(String data) throws IOException
- Writes characters to this text file input stream.
The characters that are written to the file are converted to the
specified CCSID.
- Parameters:
- data - The characters to write to the stream.
- Throws: IOException
- If an error occurs while communicating with the AS/400.
- See Also:
- getCCSID, setCCSID
All Packages Class Hierarchy This Package Previous Next Index