ibm-information-center/dist/eclipse/plugins/i5OS.ic.rzahh_5.4.0.1/ifstfos.htm

69 lines
3.9 KiB
HTML

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="en-us" xml:lang="en-us">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="security" content="public" />
<meta name="Robots" content="index,follow" />
<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
<meta name="DC.Type" content="reference" />
<meta name="DC.Title" content="IFSTextFileOutputStream class" />
<meta name="abstract" content="IFSTextFileOutputStream has been deprecated and replaced by class IFSFileWriter." />
<meta name="description" content="IFSTextFileOutputStream has been deprecated and replaced by class IFSFileWriter." />
<meta name="DC.Relation" scheme="URI" content="ifsfilewriter.htm#ifsfilewriter" />
<meta name="copyright" content="(C) Copyright IBM Corporation 2006" />
<meta name="DC.Rights.Owner" content="(C) Copyright IBM Corporation 2006" />
<meta name="DC.Format" content="XHTML" />
<meta name="DC.Identifier" content="ifstfos" />
<meta name="DC.Language" content="en-us" />
<!-- All rights reserved. Licensed Materials Property of IBM -->
<!-- US Government Users Restricted Rights -->
<!-- Use, duplication or disclosure restricted by -->
<!-- GSA ADP Schedule Contract with IBM Corp. -->
<link rel="stylesheet" type="text/css" href="./ibmdita.css" />
<link rel="stylesheet" type="text/css" href="./ic.css" />
<title>IFSTextFileOutputStream class</title>
</head>
<body id="ifstfos"><a name="ifstfos"><!-- --></a>
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
<h1 class="topictitle1">IFSTextFileOutputStream class</h1>
<div><p>IFSTextFileOutputStream has been deprecated and replaced by class
IFSFileWriter.</p>
<div class="section"><p>The <a href="javadoc/com/ibm/as400/access/IFSTextFileOutputStream.html#NAVBAR_TOP"> IFSTextFileOutputStream</a> class represents a stream of
character data being written to a file. The data supplied to the IFSTextFileOutputStream
object is in a Java™ String object so the input is always Unicode. The
IFSTextFileOutputStream object can convert the data to another CCSID as it
is written to the file, however. The default behavior is to write Unicode
characters to the file, but the Java program can set the target CCSID before
the file is opened. In this case, the IFSTextFileOutputStream object converts
the characters from Unicode to the specified CCSID before writing them to
the file. If the data cannot be converted, an UnsupportedEncodingException
is thrown.</p>
</div>
<div class="section"><h4 class="sectiontitle">Example: Using IFSTextFileOutputStream</h4><p>The following
example shows how to use IFSTextFileOutputStream:</p>
<pre> // Work with /File on the system
// mySystem.
AS400 as400 = new AS400("mySystem");
IFSTextFileOutputStream file = new IFSTextFileOutputStream(as400, "/File");
// Write a String to the file.
// Because no CCSID was specified
// before writing to the file,
// Unicode characters will be
// written to the file. The file
// will be tagged as having Unicode
// data.
file.write("Hello world");
// Close the file.
file.close();</pre>
</div>
</div>
<div><div class="relref"><strong>Related reference</strong><br />
<div><a href="ifsfilewriter.htm#ifsfilewriter" title="Use IFSFileWriter for writing character files in the integrated file system. IFSFileWriter is meant for writing streams of characters.">IFSFileWriter</a></div>
</div>
</div>
</body>
</html>