ariba.util.io
Class UnicodeEscapeInputStreamReader

java.lang.Object
  extended by java.io.Reader
      extended by java.io.InputStreamReader
          extended by ariba.util.io.UnicodeEscapeInputStreamReader
All Implemented Interfaces:
Closeable, Readable

public class UnicodeEscapeInputStreamReader
extends InputStreamReader

UnicodeEscapeInputStreamReader is a special inputStreamWriter to read from the underlying input stream and convert the data into UnicodeEscaped (Ariba's internal encoding scheme) format. This is used internally by our stubgenerator, should not be used elsewhere.


Constructor Summary
UnicodeEscapeInputStreamReader(InputStream in)
          Create an InputStreamReader that uses internal Ariba encoding.
UnicodeEscapeInputStreamReader(InputStream in, String enc)
          Constructor: we don't support this constructor.
 
Method Summary
 void close()
          Close the stream.
 String getEncoding()
          Returns the canonical name of the character encoding being used by this stream.
 int read(char[] cbuf, int off, int len)
          Read characters into a portion of an array.
 boolean ready()
          Tell whether this stream is ready to be read.
 
Methods inherited from class java.io.InputStreamReader
read
 
Methods inherited from class java.io.Reader
mark, markSupported, read, read, reset, skip
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UnicodeEscapeInputStreamReader

public UnicodeEscapeInputStreamReader(InputStream in)
Create an InputStreamReader that uses internal Ariba encoding.

Parameters:
in - An InputStream, must not be null.

UnicodeEscapeInputStreamReader

public UnicodeEscapeInputStreamReader(InputStream in,
                                      String enc)
                               throws UnsupportedEncodingException
Constructor: we don't support this constructor. It will assert.

Parameters:
in - An InputStream
enc - The encoding
Throws:
UnsupportedEncodingException - If the named encoding is not supported
Method Detail

getEncoding

public String getEncoding()
Returns the canonical name of the character encoding being used by this stream. Note that for this class, the Ariba internal UnicodeEscape encoding is used.

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

read

public int read(char[] cbuf,
                int off,
                int len)
         throws IOException
Read characters into a portion of an array.

Overrides:
read in class InputStreamReader
Parameters:
cbuf - Destination buffer
off - Offset at which to start storing characters
len - Maximum number of characters to read
Returns:
The number of characters read, or -1 if the end of the stream has been reached
Throws:
IOException - If an I/O error occurs

ready

public boolean ready()
              throws IOException
Tell whether this stream is ready to be read. An InputStreamReader is ready if its input buffer is not empty, or if bytes are available to be read from the underlying byte stream.

Overrides:
ready in class InputStreamReader
Throws:
IOException - If an I/O error occurs

close

public void close()
           throws IOException
Close the stream.

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


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