|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
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.
Note: By default, Unicode data is written to the file. To use another CCSID when writing to the file, use one of the constructors that has a ccsid parameter.
Note: This class is provided for situations where an OutputStream is required. The preferred method of writing to a text file is via IFSFileWriter
.
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();
FileEvent
,
IFSFileOutputStream.addFileListener(com.ibm.as400.access.FileListener)
,
IFSFileOutputStream.removeFileListener(com.ibm.as400.access.FileListener)
,
Serialized FormModifier and Type | Field and Description |
---|
Fields inherited from class com.ibm.as400.access.IFSFileOutputStream |
---|
changes_, fd_, SHARE_ALL, SHARE_NONE, SHARE_READERS, SHARE_WRITERS, vetos_ |
Constructor and Description |
---|
IFSTextFileOutputStream()
Constructs an IFSTextFileOutputStream object. |
IFSTextFileOutputStream(AS400 system,
IFSFile file,
int shareOption,
boolean append)
Constructs an IFSTextFileOutputStream object. |
IFSTextFileOutputStream(AS400 system,
IFSFile file,
int shareOption,
boolean append,
int ccsid)
Constructs an IFSTextFileOutputStream object. |
IFSTextFileOutputStream(AS400 system,
IFSJavaFile file,
int shareOption,
boolean append)
Constructs an IFSTextFileOutputStream object. |
IFSTextFileOutputStream(AS400 system,
IFSJavaFile file,
int shareOption,
boolean append,
int ccsid)
Constructs an IFSTextFileOutputStream object. |
IFSTextFileOutputStream(AS400 system,
String name)
Constructs an IFSTextFileOutputStream object. |
IFSTextFileOutputStream(AS400 system,
String name,
int ccsid)
Constructs an IFSTextFileOutputStream object. |
IFSTextFileOutputStream(AS400 system,
String name,
int shareOption,
boolean append)
Constructs an IFSTextFileOutputStream object. |
IFSTextFileOutputStream(AS400 system,
String name,
int shareOption,
boolean append,
int ccsid)
Constructs an IFSTextFileOutputStream object. |
IFSTextFileOutputStream(IFSFile file)
Constructs an IFSTextFileOutputStream object. |
IFSTextFileOutputStream(IFSFileDescriptor fd)
Constructs an IFSTextFileOutputStream object. |
IFSTextFileOutputStream(IFSJavaFile file)
Constructs an IFSTextFileOutputStream object. |
Modifier and Type | Method and Description |
---|---|
int |
getCCSID()
Returns the CCSID. |
void |
setCCSID(int ccsid)
Sets the CCSID for the data written to the file. |
void |
write(String data)
Writes characters to this text file input stream. |
Methods inherited from class com.ibm.as400.access.IFSFileOutputStream |
---|
addFileListener, addPropertyChangeListener, addVetoableChangeListener, close, finalize, flush, getFD, getPath, getShareOption, getSystem, lock, lock, open, removeFileListener, removePropertyChangeListener, removeVetoableChangeListener, setAppend, setFD, setPath, setShareOption, setSystem, unlock, write, write, write |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public IFSTextFileOutputStream()
public IFSTextFileOutputStream(AS400 system, String name) throws AS400SecurityException, IOException
system
- The AS400 that contains the file.name
- The file to be opened for writing.AS400SecurityException
- If a security or authority error occurs.IOException
- If an error occurs while communicating with the system.public IFSTextFileOutputStream(AS400 system, String name, int ccsid) throws AS400SecurityException, IOException
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.AS400SecurityException
- If a security or authority error occurs.IOException
- If an error occurs while communicating with the system.public IFSTextFileOutputStream(AS400 system, String name, int shareOption, boolean append) throws AS400SecurityException, IOException
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. 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.AS400SecurityException
- If a security or authority error occurs.IOException
- If an error occurs while communicating with the system.public IFSTextFileOutputStream(AS400 system, String name, int shareOption, boolean append, int ccsid) throws AS400SecurityException, IOException
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. 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.AS400SecurityException
- If a security or authority error occurs.IOException
- If an error occurs while communicating with the system.public IFSTextFileOutputStream(IFSFile file) throws AS400SecurityException, IOException
file
- The file to be opened for writing.AS400SecurityException
- If a security or authority error occurs.IOException
- If an error occurs while communicating with the system.public IFSTextFileOutputStream(AS400 system, IFSFile file, int shareOption, boolean append) throws AS400SecurityException, IOException
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. 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.AS400SecurityException
- If a security or authority error occurs.IOException
- If an error occurs while communicating with the system.public IFSTextFileOutputStream(AS400 system, IFSFile file, int shareOption, boolean append, int ccsid) throws AS400SecurityException, IOException
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. 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.AS400SecurityException
- If a security or authority error occurs.IOException
- If an error occurs while communicating with the system.public IFSTextFileOutputStream(IFSJavaFile file) throws AS400SecurityException, IOException
file
- The file to be opened for writing.AS400SecurityException
- If a security or authority error occurs.IOException
- If an error occurs while communicating with the system.public IFSTextFileOutputStream(AS400 system, IFSJavaFile file, int shareOption, boolean append) throws AS400SecurityException, IOException
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. 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.AS400SecurityException
- If a security or authority error occurs.IOException
- If an error occurs while communicating with the system.public IFSTextFileOutputStream(AS400 system, IFSJavaFile file, int shareOption, boolean append, int ccsid) throws AS400SecurityException, IOException
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. 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.AS400SecurityException
- If a security or authority error occurs.IOException
- If an error occurs while communicating with the system.public IFSTextFileOutputStream(IFSFileDescriptor fd)
fd
- The file descriptor to be opened for writing.Method Detail |
---|
public int getCCSID()
IFSFile.getCCSID()
public void setCCSID(int ccsid) throws PropertyVetoException
ccsid
- The target CCSID.PropertyVetoException
- If the change is vetoed.public void write(String data) throws IOException
data
- The characters to write to the stream.IOException
- If an error occurs while communicating with the system.getCCSID()
,
setCCSID(int)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |