ariba.util.io
Class UnicodeEscapeOutputStreamWriter

java.lang.Object
  extended by java.io.Writer
      extended by java.io.OutputStreamWriter
          extended by ariba.util.io.UnicodeEscapeOutputStreamWriter
All Implemented Interfaces:
Closeable, Flushable, Appendable

public class UnicodeEscapeOutputStreamWriter
extends OutputStreamWriter

UnicodeEscapeOutputStreamWriter is a special outputStreamWriter to write UnicodeEscaped (Ariba's internal encoding scheme) data to the underlying output stream. This is used internally by our JavaFile class, with the underlying output stream being a FileOutputStream.


Constructor Summary
UnicodeEscapeOutputStreamWriter(OutputStream out)
          Create an OutputStreamWriter that uses Ariba internal encoding scheme.
UnicodeEscapeOutputStreamWriter(OutputStream out, String enc)
          Create an OutputStreamWriter that uses the named character encoding.
 
Method Summary
 void close()
          Close the stream.
 void flush()
          Flush remaining data to the underlying output stream.
 String getEncoding()
          Returns the canonical name of the character encoding being used by this stream.
 void write(char[] cbuf, int off, int len)
          Write a portion of an array of characters.
 
Methods inherited from class java.io.OutputStreamWriter
write, write
 
Methods inherited from class java.io.Writer
append, append, append, write, write
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UnicodeEscapeOutputStreamWriter

public UnicodeEscapeOutputStreamWriter(OutputStream out,
                                       String enc)
                                throws UnsupportedEncodingException
Create an OutputStreamWriter that uses the named character encoding. We don't support this constructor because this class only uses the Ariba internal encoding. We will assert.

Parameters:
out - An OutputStream
enc - The encoding
Throws:
UnsupportedEncodingException - If the named encoding is not supported

UnicodeEscapeOutputStreamWriter

public UnicodeEscapeOutputStreamWriter(OutputStream out)
Create an OutputStreamWriter that uses Ariba internal encoding scheme.

Parameters:
out - An OutputStream, must not be null.
Method Detail

getEncoding

public String getEncoding()
Returns the canonical name of the character encoding being used by this stream.

Overrides:
getEncoding in class OutputStreamWriter
Returns:
a String representing the encoding name

write

public void write(char[] cbuf,
                  int off,
                  int len)
           throws IOException
Write a portion of an array of characters.

Overrides:
write in class OutputStreamWriter
Parameters:
cbuf - Buffer of characters
off - Offset from which to start writing characters
len - Number of characters to write
Throws:
IOException - If an I/O error occurs

flush

public void flush()
           throws IOException
Flush remaining data to the underlying output stream.

Specified by:
flush in interface Flushable
Overrides:
flush in class OutputStreamWriter
Throws:
IOException

close

public void close()
           throws IOException
Close the stream. Note that we do not call the super class's close method because they call their own flush, and we don't want to flush our data twice.

Specified by:
close in interface Closeable
Overrides:
close in class OutputStreamWriter
Throws:
IOException - If an I/O error occurs


AribaWeb User Interface Development Framework
Copyright © 2000-2009 Ariba, Inc. All Rights Reserved.