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:
java.io.Closeable, java.io.Flushable, java.lang.Appendable

public class UnicodeEscapeOutputStreamWriter
extends java.io.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(java.io.OutputStream out)
          Create an OutputStreamWriter that uses Ariba internal encoding scheme.
UnicodeEscapeOutputStreamWriter(java.io.OutputStream out, java.lang.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.
 java.lang.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(java.io.OutputStream out,
                                       java.lang.String enc)
                                throws java.io.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:
java.io.UnsupportedEncodingException - If the named encoding is not supported

UnicodeEscapeOutputStreamWriter

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

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

getEncoding

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

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

write

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

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

flush

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

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

close

public void close()
           throws java.io.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 java.io.Closeable
Overrides:
close in class java.io.OutputStreamWriter
Throws:
java.io.IOException - If an I/O error occurs


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