84 |
|
|
85 |
/** |
/** |
86 |
* This method initializes a new instance of <code>OutputStreamWriter</code> |
* This method initializes a new instance of <code>OutputStreamWriter</code> |
|
* to write to the specified stream using the default encoding. |
|
|
* |
|
|
* @param out The <code>OutputStream</code> to write to |
|
|
*/ |
|
|
public OutputStreamWriter(OutputStream out) |
|
|
{ |
|
|
this.out = EncodingManager.getEncoder(out); |
|
|
} |
|
|
|
|
|
/** |
|
|
* This method initializes a new instance of <code>OutputStreamWriter</code> |
|
87 |
* to write to the specified stream using a caller supplied character |
* to write to the specified stream using a caller supplied character |
88 |
* encoding scheme. Note that due to a deficiency in the Java language |
* encoding scheme. Note that due to a deficiency in the Java language |
89 |
* design, there is no way to determine which encodings are supported. |
* design, there is no way to determine which encodings are supported. |
102 |
} |
} |
103 |
|
|
104 |
/** |
/** |
105 |
* This method closes this stream, and the underlying |
* This method initializes a new instance of <code>OutputStreamWriter</code> |
106 |
* <code>OutputStream</code> |
* to write to the specified stream using the default encoding. |
107 |
* |
* |
108 |
* @exception IOException If an error occurs |
* @param out The <code>OutputStream</code> to write to |
109 |
*/ |
*/ |
110 |
public void close() throws IOException |
public OutputStreamWriter(OutputStream out) |
111 |
{ |
{ |
112 |
out.close(); |
this.out = EncodingManager.getEncoder(out); |
113 |
} |
} |
114 |
|
|
115 |
/** |
/** |
116 |
* This method flushes any buffered bytes to the underlying output sink. |
* This method closes this stream, and the underlying |
117 |
|
* <code>OutputStream</code> |
118 |
* |
* |
119 |
* @exception IOException If an error occurs |
* @exception IOException If an error occurs |
120 |
*/ |
*/ |
121 |
public void flush() throws IOException |
public void close() throws IOException |
122 |
{ |
{ |
123 |
out.flush(); |
out.close(); |
124 |
} |
} |
125 |
|
|
126 |
/** |
/** |
136 |
} |
} |
137 |
|
|
138 |
/** |
/** |
139 |
* This method writes a single character to the output stream. |
* This method flushes any buffered bytes to the underlying output sink. |
|
* |
|
|
* @param c The char to write, passed as an int. |
|
140 |
* |
* |
141 |
* @exception IOException If an error occurs |
* @exception IOException If an error occurs |
142 |
*/ |
*/ |
143 |
public void write(int c) throws IOException |
public void flush() throws IOException |
144 |
{ |
{ |
145 |
out.write(c); |
out.flush(); |
146 |
} |
} |
147 |
|
|
148 |
/** |
/** |
178 |
out.write(str, offset, len); |
out.write(str, offset, len); |
179 |
} |
} |
180 |
|
|
181 |
|
/** |
182 |
|
* This method writes a single character to the output stream. |
183 |
|
* |
184 |
|
* @param c The char to write, passed as an int. |
185 |
|
* |
186 |
|
* @exception IOException If an error occurs |
187 |
|
*/ |
188 |
|
public void write(int ch) throws IOException |
189 |
|
{ |
190 |
|
out.write(ch); |
191 |
|
} |
192 |
|
|
193 |
} // class OutputStreamWriter |
} // class OutputStreamWriter |
194 |
|
|