borland Packages  Class Hierarchy  jb.io Package 

EncodedOutputStream class

java.lang.Object
   +----com.borland.jb.io.SimpleCharOutputStream
           +----com.borland.jb.io.EncodedOutputStream

About the EncodedOutputStream class

Constructors  Properties  Methods  

An implementation of SimpleCharOutputStream that is optimized for data where most of the characters belong to the specified character set. Other characters are assumed to be encoded in Unicode escapes.


EncodedOutputStream constructors

EncodedOutputStream properties

*Read-only properties **Write-only properties

Properties implemented in java.lang.Object

EncodedOutputStream methods

Methods implemented in this class

Methods implemented in com.borland.jb.io.SimpleCharOutputStream

Methods implemented in java.lang.Object


EncodedOutputStream constructors

EncodedOutputStream(java.io.OutputStream)

  public EncodedOutputStream(OutputStream out)
Creates output stream encoded in the default encoding.

Parameters:

out
The output stream.

EncodedOutputStream(java.io.OutputStream, java.lang.String)

  public EncodedOutputStream(OutputStream out, String encodingString)
Creates output stream encoded in the specified encoding. Unicode characters passed in for a write() will be converted to native, potentially multibyte, forms. Characters that cannot be encoded in the specified encoding will be represented in Unicode escapes.

Parameters:

out
The output stream.
encodingString
The encoding in the resulting stream.

EncodedOutputStream(java.io.OutputStream, java.lang.String, int)

  public EncodedOutputStream(OutputStream out, String encodingString, int bufferSize)
Creates output stream encoded in the specified encoding and the specified buffer size. Currently this class does not do its own buffering -- the buffer size is ignored. Unicode characters passed in for a write() will be converted to native, potentially multibyte, forms.

Parameters:

out
The output stream.
encodingString
The encoding in the resulting stream.

EncodedOutputStream methods

close()

  public void close()
Closes the encoded output stream. Should be the last operation done with this object.

Overrides: com.borland.jb.io.SimpleCharOutputStream.close()

flush()

  public void flush()
Causes all currently buffered information to be written to the output stream.

write(int)

  public void write(int ch)
Writes the character represented by the ch parameter. This method will block until the byte is actually written.

This method throws an IOException if an I/O error has occurred. The destination is encoded with the specified character set. Characters that cannot be encoded in the specified character set are encoded with Unicode escapes, like "?". Malformed Unicode characters (characters that are invalid in any encoding) are converted to '?'.

Parameters:

ch
The character to be written.

Overrides: com.borland.jb.io.SimpleCharOutputStream.write(int)