Java Doc for OutputStreamWriter.java in  » Apache-Harmony-Java-SE » java-package » java » io » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Apache Harmony Java SE » java package » java.io 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   java.io.Writer
      java.io.OutputStreamWriter

All known Subclasses:   java.io.FileWriter,
OutputStreamWriter
public class OutputStreamWriter extends Writer (Code)
OutputStreamWriter is a class for turning a character output stream into a byte output stream. The conversion of Unicode characters to their byte equivalents is determined by the converter used. By default, the encoding is ISO8859_1 (ISO-Latin-1) but can be changed by calling the constructor which takes an encoding.
See Also:   InputStreamReader



Constructor Summary
public  OutputStreamWriter(OutputStream out)
     Constructs a new OutputStreamWriter using out as the OutputStream to write converted characters to.
public  OutputStreamWriter(OutputStream out, String enc)
     Constructs a new OutputStreamWriter using out as the OutputStream to write converted characters to and enc as the character encoding.
public  OutputStreamWriter(OutputStream out, Charset cs)
     Constructs a new OutputStreamWriter using out as the OutputStream to write converted characters to and cs as the character encoding.
public  OutputStreamWriter(OutputStream out, CharsetEncoder enc)
     Constructs a new OutputStreamWriter using out as the OutputStream to write converted characters to and enc as the character encoding.

Method Summary
public  voidclose()
     Close this OutputStreamWriter.
public  voidflush()
     Flush this OutputStreamWriter.
public  StringgetEncoding()
     Answer the String which identifies the encoding used to convert characters to bytes.
public  voidwrite(char[] buf, int offset, int count)
     Writes count characters starting at offset in buf to this Writer.
public  voidwrite(int oneChar)
     Writes out the character oneChar to this Writer.
public  voidwrite(String str, int offset, int count)
     Writes count characters starting at offset in str to this Writer.


Constructor Detail
OutputStreamWriter
public OutputStreamWriter(OutputStream out)(Code)
Constructs a new OutputStreamWriter using out as the OutputStream to write converted characters to. The default character encoding is used (see class description).
Parameters:
  out - the non-null OutputStream to write converted bytes to.



OutputStreamWriter
public OutputStreamWriter(OutputStream out, String enc) throws UnsupportedEncodingException(Code)
Constructs a new OutputStreamWriter using out as the OutputStream to write converted characters to and enc as the character encoding. If the encoding cannot be found, an UnsupportedEncodingException error is thrown.
Parameters:
  out - the non-null OutputStream to write converted bytes to.
Parameters:
  enc - the non-null String describing the desired character encoding.
throws:
  UnsupportedEncodingException - if the encoding cannot be found.



OutputStreamWriter
public OutputStreamWriter(OutputStream out, Charset cs)(Code)
Constructs a new OutputStreamWriter using out as the OutputStream to write converted characters to and cs as the character encoding.
Parameters:
  out - the non-null OutputStream to write converted bytes to.
Parameters:
  cs - the non-null Charset which specify the character encoding.



OutputStreamWriter
public OutputStreamWriter(OutputStream out, CharsetEncoder enc)(Code)
Constructs a new OutputStreamWriter using out as the OutputStream to write converted characters to and enc as the character encoding.
Parameters:
  out - the non-null OutputStream to write converted bytes to.
Parameters:
  enc - the non-null CharsetEncoder which used to character encoding.




Method Detail
close
public void close() throws IOException(Code)
Close this OutputStreamWriter. This implementation first flushes the buffer and the target OutputStream. The OutputStream is then closed and the resources for the buffer and converter are freed.

Only the first invocation of this method has any effect. Subsequent calls do no work.
throws:
  IOException - If an error occurs attempting to close thisOutputStreamWriter.




flush
public void flush() throws IOException(Code)
Flush this OutputStreamWriter. This implementation ensures all buffered bytes are written to the target OutputStream. After writing the bytes, the target OutputStream is then flushed.
throws:
  IOException - If an error occurs attempting to flush thisOutputStreamWriter.



getEncoding
public String getEncoding()(Code)
Answer the String which identifies the encoding used to convert characters to bytes. The value null is returned if this Writer has been closed. the String describing the converter or null if this Writer isclosed.



write
public void write(char[] buf, int offset, int count) throws IOException(Code)
Writes count characters starting at offset in buf to this Writer. The characters are immediately converted to bytes by the character converter and stored in a local buffer. If the buffer becomes full as a result of this write, this Writer is flushed.
Parameters:
  buf - the non-null array containing characters to write.
Parameters:
  offset - offset in buf to retrieve characters
Parameters:
  count - maximum number of characters to write
throws:
  IOException - If this OutputStreamWriter has already been closed or someother IOException occurs.
throws:
  IndexOutOfBoundsException - If offset or count is outside of bounds.



write
public void write(int oneChar) throws IOException(Code)
Writes out the character oneChar to this Writer. The low-order 2 bytes are immediately converted to bytes by the character converter and stored in a local buffer. If the buffer becomes full as a result of this write, this Writer is flushed.
Parameters:
  oneChar - the character to write
throws:
  IOException - If this OutputStreamWriter has already been closed or someother IOException occurs.



write
public void write(String str, int offset, int count) throws IOException(Code)
Writes count characters starting at offset in str to this Writer. The characters are immediately converted to bytes by the character converter and stored in a local buffer. If the buffer becomes full as a result of this write, this Writer is flushed.
Parameters:
  str - the non-null String containing characters to write.
Parameters:
  offset - offset in str to retrieve characters
Parameters:
  count - maximum number of characters to write
throws:
  IOException - If this OutputStreamWriter has already been closed or someother IOException occurs.
throws:
  IndexOutOfBoundsException - If count is negative
throws:
  StringIndexOutOfBoundsException - If offset is negative or offset + count is outside of bounds



Fields inherited from java.io.Writer
final static String TOKEN_NULL(Code)(Java Doc)
protected Object lock(Code)(Java Doc)

Methods inherited from java.io.Writer
public Writer append(char c) throws IOException(Code)(Java Doc)
public Writer append(CharSequence csq) throws IOException(Code)(Java Doc)
public Writer append(CharSequence csq, int start, int end) throws IOException(Code)(Java Doc)
abstract public void close() throws IOException(Code)(Java Doc)
abstract public void flush() throws IOException(Code)(Java Doc)
public void write(char buf) throws IOException(Code)(Java Doc)
abstract public void write(char buf, int offset, int count) throws IOException(Code)(Java Doc)
public void write(int oneChar) throws IOException(Code)(Java Doc)
public void write(String str) throws IOException(Code)(Java Doc)
public void write(String str, int offset, int count) throws IOException(Code)(Java Doc)

Methods inherited from java.lang.Object
protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object object)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final public Class<? extends Object> getClass()(Code)(Java Doc)
public int hashCode()(Code)(Java Doc)
final public void notify()(Code)(Java Doc)
final public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final public void wait(long millis, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait(long millis) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.